4 Replies Latest reply on Jul 6, 2015 5:58 AM by jewellgm

    Quartz module installation not working

    tailorbird

      I was trying to deploy my application in WildFly 8.2.0 and getting the following errors. It is not able to find the quarts jar, where I have installed it as a module with the help of this documentation.

       

      error:

       

      Caused by: java.lang.NoClassDefFoundError: org/quartz/Trigger

              at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_80]

              at java.lang.Class.privateGetDeclaredFields(Class.java:2509) [rt.jar:1.7.0_80]

              at java.lang.Class.getDeclaredFields(Class.java:1819) [rt.jar:1.7.0_80]

              at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]

              at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:68) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]

       

       

      I have the jar file and module.xml inside the

      /modules/org/quartz/main

       

      module.xml:

       

      <module xmlns="urn:jboss:module:1.1" name="org.quartz"> 

        <resources> 

          <resource-root path="quartz-2.0.2.jar"/> 

        </resources> 

        <dependencies> 

                <module name="org.slf4j"/> 

                <module name="javax.api"/> 

        </dependencies> 

      </module> 

       

       

      What else I have to do to take this dependency in action? Do we need to specify this quartz module info somewhere else?

       

      Tried putting Dependency: org.quartz in MANIFEST.MF and in jboss-deployment-structure.xml. But not worked.

       

      <jboss-deployment-structure>

          <deployment>

      <dependencies>

                  <module name="org.quartz" />

              </dependencies>      

          </deployment>

      </jboss-deployment-structure>

        • 1. Re: Quartz module installation not working
          jewellgm

          Which MANIFEST.MF did you place the dependency in?  If it was in the ear's manifest, you would need to add the keyword "export" after the entry, making it visible to the subcomponents within the ear.

           

          For example:

           

          Dependencies: org.quartz export

          1 of 1 people found this helpful
          • 2. Re: Quartz module installation not working
            jewellgm

            One other thing -- you mentioned that you placed your module.xml and jar file in modules/org/quartz/main.  With WildFly 8, modules were moved into modules/system/layers/base.  Have you tried moving your module into modules/system/layers/base/org/quartz/main ?

            • 3. Re: Quartz module installation not working
              tailorbird

              Hello Greg,

              Thanks for your help! I have a doubt. For JBoss to identify the module and its jar, a  jboss-deployment-structure.xml. is mandatory right? Since we are putting this inside the META-INF, will that make any issue, if I deploy the EAR in some other server, like Websphere? (My question is ,can we make this module/jar available to the server some other means independent to the EAR). I am a newbie in WildFly.

              • 4. Re: Quartz module installation not working
                jewellgm

                Modifying the jboss-deployment-structure.xml is one way to make modules visible to an application, but not the only way.  Adding the "Dependencies" MANIFEST entry will achieve the same result.  If you add it to the ear's MANIFEST (and export it), the module will become visible to everything in the ear.  If you add the entry to a single module within the ear, like a jar file, will make the module visible to only that module.  There's also a concept of a "global module", where you can make a change to the standalone.xml, which will make the module visible to all of the applications.

                 

                Class Loading in WildFly - WildFly 8 - Project Documentation Editor