1 Reply Latest reply on Aug 9, 2011 3:04 PM by andrey.vorobiev

    How to configure Quartz scheduler in JBoss AS 6.0?

    andrey.vorobiev

      I've performed following steps:

      1. Created deploy/quartz-service.xml
      2. Added quartz-jboss.jar to common/lib

       

      Now I need quartz-service to be started after my application is deployed in order to guarantee that my application classes are avaliable to Quartz scheduler. To archive this I've tried adding following dependencies inside quartz-service.xml (object names were obtained from jndi tree)

       

      <depends>jboss.j2ee:service=EARDeployment,url='my.ear'</depends>
      

      (as far as I understand this way isn't applicable to version 6.0)

       

      <depends>jboss.classloader:id="vfs:///opt/jboss/server/default/deploy/my.ear"</depends>
      

       

       

      <depends>jboss.management.local:J2EEServer=Local,j2eeType=J2EEApplication,name=my.ear</depends>
      

       

      But as result I get the following:

       

      DEPLOYMENTS MISSING DEPENDENCIES:
        Deployment "user:name=QuartzService,service=QuartzService" is missing the following dependencies:
          Dependency "<object name described above>'" (should be in state "Create", but is actually in state "** NOT FOUND Depends on '<object name described above>'' **")
      
      

       

      Does anyone can suggest a way for adding dependency on application?

        • 1. Re: How to configure Quartz scheduler in JBoss AS 6.0?
          andrey.vorobiev

          As for me I solved this problem in the following way:

          1. Created custom service inside ear with dependency on quartz-service.

          2. Restricted scheduler autostart: <attribute name="StartScheduler">false</attribute> inside quartz-service.xml

          3. And now I start scheduler manually during my custom service statup.

           

          But one qustion still remains:

           

          My quartz job implementaion class resides inside my.ear deployment. As far I understand this class isn't visible from quartz scheduler classloader. So the qustion is about how can I make it visible for quarts service?

           

          My current jboss-classloading configuration is:

           

          my.ear/META-INF/jboss-classloading.xml

          <?xml version="1.0" encoding="UTF-8"?>
          <classloading xmlns="urn:jboss:classloading:1.0"
                       domain="my.ear"
                       parent-domain="DefaultDomain"
                        export-all="NON_EMPTY"
                       import-all="true"
                       parent-first="true">
          </classloading>
          

           

          quartz-service.sar/META-INF/jboss-classloading.xml

          <?xml version="1.0" encoding="UTF-8"?>
          <classloading xmlns="urn:jboss:classloading:1.0"
                       domain="quartz-service"
                       parent-domain="DefaultDomain"
                       export-all="NON_EMPTY"
                       import-all="true"
                       parent-first="true">
          </classloading>