2 Replies Latest reply on Oct 3, 2012 6:24 PM by Bill Rosenberg

    Class Loading and Modules

    Bill Rosenberg Newbie

      here is my deployment outline for AS7:

       

      JB7.ear

      --jboss-deployment-structure.xml

      --JB7EJB.jar

      --JB7Web.war

      --JB7Dao.jar

       

       

      I have a question regarding AS7 module class loading. I am trying to use the quartz library and setup a module to

      do so. I updated the jboss-deployment-structure.xml to look like this after setting up my quartz module

       

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">

          <ear-subdeployments-isolated>true</ear-subdeployments-isolated>

          <deployment>

              <dependencies>

                  

                  <module name="org.hibernate" slot="3" />

                   <module name="org.quartz" />

                  

              </dependencies>

          </deployment>

       

      </jboss-deployment-structure>

       

      when i deploy and run the app a getthis exception:

       

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

          at com.lightspeed.ejb.Session1.hello(Session1.java:22) [JB7EJB.jar:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_13]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_13]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_13]

          at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_13]

          at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          ... 37 more

         

      When i change the  jboss-deployment-structure.xml to look like this, it runs fine:

       

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">

          <ear-subdeployments-isolated>true</ear-subdeployments-isolated>

          <deployment>

              <dependencies>

                  

                   <module name="org.hibernate" slot="3" />

                 

                  

              </dependencies>

          </deployment>

          <sub-deployment name="JB7EJB.jar">

              <dependencies>

                  

                  <module name="org.quartz" />

                 

              </dependencies>

          </sub-deployment>

      </jboss-deployment-structure>

       

       

      I thought that if i put the dependencies under the top 'deployment' section, that all deployments will pick up the quartz module, but i have to add the

        '<sub-deployment name="JB7EJB.jar">' section to have the JB7EJB deloyment pick up the quartz module.

       

      What am i missing here?

       

      thank you,

       

      Bill