Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: 0.6.0
    • Fix Version/s: 0.7.0
    • Labels:
      None
    • Environment:
      OS X v10.8.2, Java v1.6.0_37, Clojure v1.4.0, nREPL 1.5.0
    • Steps to Reproduce:
      Hide

      1. Startup Immutant/JBoss instance without anything running besides nREPL.
      2. Connect to instance via nREPL (from Emacs).
      3. In REPL execute:
      user> (require '[immutant.jobs :as jobs])
      4. In REPL execute:
      user> (jobs/schedule "test-job" "*/5 * * * * ?" #(println "Job executed!") :singleton true)

      Outputs

      nrepl Buffer:
      ClassCastException java.lang.Class.cast (Class.java:2990)

      nREPL error Buffer:
      java.lang.ClassCastException:
      Class.java:2990 java.lang.Class.cast
      Reflector.java:411 clojure.lang.Reflector.boxArg
      Reflector.java:444 clojure.lang.Reflector.boxArgs
      Reflector.java:58 clojure.lang.Reflector.invokeMatchingMethod
      Reflector.java:28 clojure.lang.Reflector.invokeInstanceMethod
      internal.clj:87 immutant.jobs.internal/create-job[fn]
      internal.clj:49 immutant.jobs.internal/wait-for-scheduler
      internal.clj:46 immutant.jobs.internal/wait-for-scheduler
      internal.clj:83 immutant.jobs.internal/create-job[fn]
      (Unknown Source) immutant.jobs.internal.proxy$org.projectodd.polyglot.jobs.BaseScheduledJob$ScheduledJobMBean$662f731a.start
      internal.clj:79 immutant.jobs.internal/create-job
      jobs.clj:45 immutant.jobs/schedule
      RestFn.java:494 clojure.lang.RestFn.invoke
      NO_SOURCE_FILE:1 user/eval1820
      Compiler.java:6511 clojure.lang.Compiler.eval
      Compiler.java:6477 clojure.lang.Compiler.eval
      core.clj:2797 clojure.core/eval
      main.clj:245 clojure.main/repl[fn]
      main.clj:266 clojure.main/repl[fn]
      main.clj:266 clojure.main/repl
      RestFn.java:1096 clojure.lang.RestFn.invoke
      interruptible_eval.clj:58 clojure.tools.nrepl.middleware.interruptible-eval/evaluate[fn]
      AFn.java:159 clojure.lang.AFn.applyToHelper
      AFn.java:151 clojure.lang.AFn.applyTo
      core.clj:601 clojure.core/apply
      core.clj:1771 clojure.core/with-bindings*
      RestFn.java:425 clojure.lang.RestFn.invoke
      interruptible_eval.clj:43 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
      interruptible_eval.clj:173 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval[fn]
      core.clj:2278 clojure.core/comp[fn]
      interruptible_eval.clj:140 clojure.tools.nrepl.middleware.interruptible-eval/run-next[fn]
      AFn.java:24 clojure.lang.AFn.run
      ThreadPoolExecutor.java:886 java.util.concurrent.ThreadPoolExecutor$Worker.runTask
      ThreadPoolExecutor.java:908 java.util.concurrent.ThreadPoolExecutor$Worker.run
      Thread.java:680 java.lang.Thread.run

      Console:
      13:55:53,843 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
      13:55:53,846 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
      13:55:53,846 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.x.incremental.129 "Arges" started in 11293ms - Started 186 of 268 services (81 services are passive or on-demand)
      13:59:46,882 INFO [immutant.jobs] (nREPL-worker-1) Scheduling job test-job at */5 * * * * ?
      13:59:46,883 INFO [immutant.jobs.internal] (nREPL-worker-1) Creating job scheduler for stardust singleton: true
      13:59:46,915 INFO [org.quartz.impl.StdSchedulerFactory] (MSC service thread 1-7) Using default implementation for ThreadExecutor
      13:59:46,937 INFO [org.quartz.core.SchedulerSignalerImpl] (MSC service thread 1-7) Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
      13:59:46,938 INFO [org.quartz.core.QuartzScheduler] (MSC service thread 1-7) Quartz Scheduler v.2.1.5 created.
      13:59:46,939 INFO [org.quartz.simpl.RAMJobStore] (MSC service thread 1-7) RAMJobStore initialized.
      13:59:46,940 INFO [org.quartz.core.QuartzScheduler] (MSC service thread 1-7) Scheduler meta-data: Quartz Scheduler (v2.1.5) 'JobScheduler$stardust.clj' with instanceId 'NON_CLUSTERED'
      Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
      NOT STARTED.
      Currently in standby mode.
      Number of jobs executed: 0
      Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 3 threads.
      Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

      13:59:46,941 INFO [org.quartz.impl.StdSchedulerFactory] (MSC service thread 1-7) Quartz scheduler 'JobScheduler$stardust.clj' initialized from an externally provided properties instance.
      13:59:46,941 INFO [org.quartz.impl.StdSchedulerFactory] (MSC service thread 1-7) Quartz scheduler version: 2.1.5
      13:59:46,941 INFO [org.quartz.core.QuartzScheduler] (MSC service thread 1-7) JobFactory set to: org.immutant.jobs.JobScheduler@4a12b8
      13:59:46,941 INFO [org.quartz.core.QuartzScheduler] (MSC service thread 1-7) Scheduler JobScheduler$stardust.clj_$_NON_CLUSTERED started.

      Show
      1. Startup Immutant/JBoss instance without anything running besides nREPL. 2. Connect to instance via nREPL (from Emacs). 3. In REPL execute: user> (require ' [immutant.jobs :as jobs] ) 4. In REPL execute: user> (jobs/schedule "test-job" "*/5 * * * * ?" #(println "Job executed!") :singleton true) Outputs nrepl Buffer: ClassCastException java.lang.Class.cast (Class.java:2990) nREPL error Buffer: java.lang.ClassCastException: Class.java:2990 java.lang.Class.cast Reflector.java:411 clojure.lang.Reflector.boxArg Reflector.java:444 clojure.lang.Reflector.boxArgs Reflector.java:58 clojure.lang.Reflector.invokeMatchingMethod Reflector.java:28 clojure.lang.Reflector.invokeInstanceMethod internal.clj:87 immutant.jobs.internal/create-job [fn] internal.clj:49 immutant.jobs.internal/wait-for-scheduler internal.clj:46 immutant.jobs.internal/wait-for-scheduler internal.clj:83 immutant.jobs.internal/create-job [fn] (Unknown Source) immutant.jobs.internal.proxy$org.projectodd.polyglot.jobs.BaseScheduledJob$ScheduledJobMBean$662f731a.start internal.clj:79 immutant.jobs.internal/create-job jobs.clj:45 immutant.jobs/schedule RestFn.java:494 clojure.lang.RestFn.invoke NO_SOURCE_FILE:1 user/eval1820 Compiler.java:6511 clojure.lang.Compiler.eval Compiler.java:6477 clojure.lang.Compiler.eval core.clj:2797 clojure.core/eval main.clj:245 clojure.main/repl [fn] main.clj:266 clojure.main/repl [fn] main.clj:266 clojure.main/repl RestFn.java:1096 clojure.lang.RestFn.invoke interruptible_eval.clj:58 clojure.tools.nrepl.middleware.interruptible-eval/evaluate [fn] AFn.java:159 clojure.lang.AFn.applyToHelper AFn.java:151 clojure.lang.AFn.applyTo core.clj:601 clojure.core/apply core.clj:1771 clojure.core/with-bindings* RestFn.java:425 clojure.lang.RestFn.invoke interruptible_eval.clj:43 clojure.tools.nrepl.middleware.interruptible-eval/evaluate interruptible_eval.clj:173 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval [fn] core.clj:2278 clojure.core/comp [fn] interruptible_eval.clj:140 clojure.tools.nrepl.middleware.interruptible-eval/run-next [fn] AFn.java:24 clojure.lang.AFn.run ThreadPoolExecutor.java:886 java.util.concurrent.ThreadPoolExecutor$Worker.runTask ThreadPoolExecutor.java:908 java.util.concurrent.ThreadPoolExecutor$Worker.run Thread.java:680 java.lang.Thread.run Console: 13:55:53,843 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management 13:55:53,846 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990 13:55:53,846 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.x.incremental.129 "Arges" started in 11293ms - Started 186 of 268 services (81 services are passive or on-demand) 13:59:46,882 INFO [immutant.jobs] (nREPL-worker-1) Scheduling job test-job at */5 * * * * ? 13:59:46,883 INFO [immutant.jobs.internal] (nREPL-worker-1) Creating job scheduler for stardust singleton: true 13:59:46,915 INFO [org.quartz.impl.StdSchedulerFactory] (MSC service thread 1-7) Using default implementation for ThreadExecutor 13:59:46,937 INFO [org.quartz.core.SchedulerSignalerImpl] (MSC service thread 1-7) Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl 13:59:46,938 INFO [org.quartz.core.QuartzScheduler] (MSC service thread 1-7) Quartz Scheduler v.2.1.5 created. 13:59:46,939 INFO [org.quartz.simpl.RAMJobStore] (MSC service thread 1-7) RAMJobStore initialized. 13:59:46,940 INFO [org.quartz.core.QuartzScheduler] (MSC service thread 1-7) Scheduler meta-data: Quartz Scheduler (v2.1.5) 'JobScheduler$stardust.clj' with instanceId 'NON_CLUSTERED' Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally. NOT STARTED. Currently in standby mode. Number of jobs executed: 0 Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 3 threads. Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered. 13:59:46,941 INFO [org.quartz.impl.StdSchedulerFactory] (MSC service thread 1-7) Quartz scheduler 'JobScheduler$stardust.clj' initialized from an externally provided properties instance. 13:59:46,941 INFO [org.quartz.impl.StdSchedulerFactory] (MSC service thread 1-7) Quartz scheduler version: 2.1.5 13:59:46,941 INFO [org.quartz.core.QuartzScheduler] (MSC service thread 1-7) JobFactory set to: org.immutant.jobs.JobScheduler@4a12b8 13:59:46,941 INFO [org.quartz.core.QuartzScheduler] (MSC service thread 1-7) Scheduler JobScheduler$stardust.clj_$_NON_CLUSTERED started.
    • Similar Issues:
      Show 10 results 

      Description

      Scheduling the following (simple) job:

      (jobs/schedule "test-job" "*/5 * * * * ?" #(println "Job executed!") :singleton true)

      does not schedule and execute the job, but throws a ClassCastException (see Steps to Reproduce for details).

        Issue Links

          Activity

          Hide
          Jim Crossley
          added a comment -

          Seems to only be an issue when the immutant version in project.clj doesn't match the version of the immutant in which the app is running. IMMUTANT-169 should address that.

          Show
          Jim Crossley
          added a comment - Seems to only be an issue when the immutant version in project.clj doesn't match the version of the immutant in which the app is running. IMMUTANT-169 should address that.
          Hide
          Toby Crawley
          added a comment -

          Fixed by IMMUTANT-169.

          Show
          Toby Crawley
          added a comment - Fixed by IMMUTANT-169 .

            People

            • Assignee:
              Unassigned
              Reporter:
              Christian Kebekus
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: