6 Replies Latest reply on Apr 25, 2008 3:25 AM by aisrael

    Problem with Quartz Scheduler Integration (JBoss AS 4.2.2)

    aisrael

      Hi, all.

      I've been trying to follow the example in the docs here:
      http://www.jboss.org/jbossejb3/docs/tutorial/jca/inflow/quartz/quartz.html

      But am getting an exception when I deploy my EJB (JAR):

      2008-04-23 16:15:34,694 DEBUG [org.jboss.ejb3.mdb.MdbDelegateWrapper] Starting failed jboss.j2ee:jar=ese-engine.jar,name=SyncBatch,service=EJB3
      org.jboss.deployment.DeploymentException: MessagingType 'org.quartz.StatefulJob' not found in resource deployment jboss.jca:service=RARDeployment,name='jms-ra.rar'
       at org.jboss.resource.deployment.RARDeployment.createActivationSpec(RARDeployment.java:252)
       at org.jboss.resource.deployment.RARDeployment.internalInvoke(RARDeployment.java:218)
       at org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSupport.java:156)
       at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.ejb3.JmxClientKernelAbstraction.invoke(JmxClientKernelAbstraction.java:44)
       at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.createActivationSpec(JBossMessageEndpointFactory.java:285)
       at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.start(JBossMessageEndpointFactory.java:189)
       at org.jboss.ejb3.mdb.MessagingContainer.startProxies(MessagingContainer.java:190)
       at org.jboss.ejb3.mdb.MessagingContainer.start(MessagingContainer.java:156)
       at org.jboss.ejb3.mdb.MDB.start(MDB.java:126)
      

      Later on in the logs it also says:
      2008-04-23 16:15:34,699 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Incomplete Deployment listing:
      
      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:jar=myejb.jar,name=MyJob,service=EJB3
       State: FAILED
       Reason: org.jboss.deployment.DeploymentException: MessagingType 'org.quartz.StatefulJob' not found in resource deployment jboss.jca:service=RARDeployment,name='jms-ra.rar'

      I've tried using both org.quartz.Job and org.quartz.StatefulJob to the same effect.

      I haven't changed anything in my JBoss installation: quartz-ra.rar is there in server/default/deploy.

      I don't know if it matters but I'm building and deploying my project using Eclipse, and I'm compiling against Quartz 1.6.0 (whereas the Quartz version bundled with JBoss AS is 1.5.2 I believe).

      Wondering if anyone else has either a) encountered the same problem, or better yet, b) been able to make the JBoss Quartz scheduler integration work.

        • 1. Re: Problem with Quartz Scheduler Integration (JBoss AS 4.2.
          jaikiran

          Are you packaging the quartz-1.6.0 jar along with your application? Does it work if you don't include that?

          • 2. Re: Problem with Quartz Scheduler Integration (JBoss AS 4.2.
            aisrael

            Nope. quartz-1.6.0.jar is in server/default/lib.

            I don't exactly know how to package the quartz.jar in my EJB JAR file (there's no "lib" directory like with WARs) and in any case, I'm just using Maven 2 to package the EJB and it doesn't include any dependencies in the JAR.

            I've also tried it with the 'stock' quartz.jar (1.5.2) with the same results.

            It seems to me like JBoss is associating my Job with the "jms-ra.rar" inflow resource adapter, rather than the "quartz-ra.rar" resource adapter as would be expected.

            At this point, even just confirmation of whether anyone else has been able to get the example to work (or whether they're encountering the same problem) on JBoss 4.2.2 would be helpful.

            • 3. Re: Problem with Quartz Scheduler Integration (JBoss AS 4.2.
              jaikiran

               

              "aisrael" wrote:


              At this point, even just confirmation of whether anyone else has been able to get the example to work (or whether they're encountering the same problem) on JBoss 4.2.2 would be helpful.


              I tried that example, after seeing your post yesterday. I have been able to get it working without any issues. Note that, i don't have Maven in picture, on my setup.

              • 4. Re: Problem with Quartz Scheduler Integration (JBoss AS 4.2.
                aisrael

                Thanks. Will try again with an Ant build and an absolutely fresh install of JBoss 4.2.

                I've tried building and deploying using both Eclipse and Maven 2 so I'm not sure it's entirely build related.

                Will also try it on Windows XP to rule out anything platform related (am running on JDK 1.5.0_13-b05-241 on OS X 10.4 if that makes any difference).

                • 5. Re: Problem with Quartz Scheduler Integration (JBoss AS 4.2.
                  jaikiran

                  Can you please post your code? Also, the logs from server.log file?

                  • 6. Re: Problem with Quartz Scheduler Integration (JBoss AS 4.2.
                    aisrael

                    Sorry, found my problem.

                    My problems was using the wrong annotation. At first, I was compiling against jboss-ext3-ext-api.jar and using the org.jboss.ejb3.annotation.ResourceAdapter annotation.

                    Eventually figured out that I needed the org.jboss.annotation.ejb.ResourceAdapter annotation, which I got from the jboss-annotations-ejb3.jar. If anyone's interested in the Maven 2 config for this, you'll need to add:

                    <dependency>
                     <groupId>jboss</groupId>
                     <artifactId>jboss-annotations-ejb3</artifactId>
                     <version>4.2.2.GA</version>
                     <scope>compile</scope>
                     </dependency>
                    
                    and
                    <repository>
                     <id>jboss</id>
                     <url>http://repository.jboss.org/maven2/</url>
                     </repository>
                    to your pom.xml.

                    Worked like a charm after that! :)