2 Replies Latest reply on Feb 24, 2012 3:46 AM by Tomislav Mihaldinec

    Jboss 7 class-loading and module loading

    Tomislav Mihaldinec Newbie

      Hi,

      I have a EAR which consists of few pain jars and WAR's.

      Problem is that whan is start deployment of this ear i constantly receive:

       

      21:00:16,982 WARN  [org.jboss.modules] (MSC service thread 1-6) Failed to define class com.web.app.webapps.common.virtualoperators.WebAppsRequestContext in Module "deployment.myear.ear.MYAPP-WebApps-Common.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link com/web/app/webaps/common/virtualoperators/WebAppsRequestContext (Module "deployment.myear.ear.MYAPP-WebApps-Common.jar:main" from Service Module Loader)

              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.Module.loadModuleClass(Module.java:517) [jboss-modules.jar:1.1.1.GA]

      and

      Caused by: java.lang.NoClassDefFoundError: com/web/app/aaa/common/virtualoperators/AbstractRequestContext

              at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_27]

              at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [rt.jar:1.6.0_27]

              at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [rt.jar:1.6.0_27]

              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [rt.jar:1.6.0_27]

              at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) [jboss-modules.jar:1.1.1.GA]

              ... 24 more

      Caused by: java.lang.ClassNotFoundException: com.web.app.aaa.common.virtualoperators.AbstractRequestContext from [Module "deployment.myear.ear.MYAPP-WebApps-Common.jar:main" from Service Module Loader]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]

              ... 30 more

       

      21:00:17,006 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.deployment.subunit."myear.ear"."MYAPP-WebApps-Billing.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."myear.ear"."MYAPP-WebApps-Billing.war".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "MYAPP-WebApps-Billing.war" of deployment "myear.ear"

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_27]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_27]

              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_27]

      Caused by: java.lang.RuntimeException: Error getting reflective information for class com.web.webapps.billing.servlets.BillingServlet with ClassLoader ModuleClassLoader for Module "deployment.myear.ear.MYAPP-WebApps-Billing.war:main" from Service Module Loader

              at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

              at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)

              at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:70)

              at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:117)

              at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:54)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

              ... 5 more

      Caused by: java.lang.NoClassDefFoundError: com/web/app/webapps/common/virtualoperators/WebAppsRequestContext

              at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.6.0_27]

              at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) [rt.jar:1.6.0_27]

              at java.lang.Class.getDeclaredMethods(Class.java:1791) [rt.jar:1.6.0_27]

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

              at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

              ... 10 more

       

       

      my ear structure

       

      myear

           |     lib/log4j and stuff

           |     ------ MYAPP-WebApps-Common.jar (com.web.app.webapps.common.virtualoperators)

           |     ------ MYAPP-AAA-Common.jar (com.web.app.aaa.common.virtualoperators)

           |

           |     ------ MYAPP-WebApps-Billing.war

       

       

      both war have MANIFEST.MF with Class-Path which icludes both jars

       

      i tried to solve this through jar/META-INF/MANIFEST.MF by adding: Dependencies: deployment.myear.ear.MYAPP-WebApps-Common.jar and also tried (just tried) with jboss-deployment-structure.xml but nothing helps..

       

      Its important to say that this ear works without any problem on IBM Websphere

       

      can you please halp me to solve this cross talking issue between jars and wars

       

      thank you

      BR

      Tomislav

        • 1. Re: Jboss 7 class-loading and module loading
          Stephen Coy Master

          Hi there,

           

          Welcome to the JBoss Community!

           

          Can you please respond with the output of:

           

          {code}jar tf myear.ear{code}

          as your ASCII art is not very clear.

           

          Additionally, can you attach your application.xml file?

           

          Generally, you want all jars in the EAR/lib directory and the WAR in the root of the EAR.

           

          A common error is to list library jars in the application.xml file too.

          • 2. Re: Jboss 7 class-loading and module loading
            Tomislav Mihaldinec Newbie

            Hi,

             

            i cannot post output of ear because of security reasons (productive application for user login).

            i solved a problem by moving every jar in EAR/lib directory but i would like to preserver ear same as i twas before.

            is there any way to list all lib directories that will ear count as lib?

            in ear we have:

            Ear/log4 dir, ear/oracle dir, ear/b2b dir and all of them ar lib directories

             

            also, when i fixed this problem as you mentioned, now i have different one.

             

            in my ear i have number of wars.

            problem is that war lat say MYAPP-WebApps-Auth.war uses classes from MYAPP-WebApps-Billing.war, MYAPP-WebApps-Error.war, MYAPP-WebApps-System.war, MYAPP-WebApps-Subs.war

             

            and i reveive:

            23:35:28,007 ERROR [] (MSC service thread 1-6) Exception during initialization of module checkSessionExistsPlugin(class=xxxxxx.logindomainredirector.plugins.CheckSessionExistsPlugin):

            java.lang.RuntimeException: Error during creation of Module checkSessionExistsPlugin(class=xxxxxxxxxx.logindomainredirector.plugins.CheckSessionExistsPlugin

             

            Caused by: java.lang.ClassNotFoundException: xxxxxxxxxxx.plugins.CheckSessionExistsPlugin from [Module "de

            ployment.myear.ear:main" from Service Module Loader]

             

            im sorry that i cannot post full stack because of company regulations.

             

            bottom line is that i need to tell wars to communicate between themself, to make classes visible between them

             

             

            thanks

            Tomislav