0 Replies Latest reply on Mar 14, 2012 8:02 AM by tepih tepih

    jboss deployment structure - why did this helped me?

    tepih tepih Newbie

      Ok,

       

               I solved the problem with classnotfound exception but I am not sure how what I did helped me...

       

       

               I have a web module which has in WEB-INF/lib axis jars. This web module calls remote web service. It uses client implementation which is in EAR/lib placed there as utility jar.

               Here is the exception I had (myclient.jar is in ear/lib, myclient uses AXIS which is in web module lib):

       

      12:35:56,296 WARN  [org.jboss.modules] (http--127.0.0.1-8081-1) Failed to define class myclient.faults.FaultPojo in Module "deployment.myapp.ear:main" from Service Module Loader: java.lang.LinkageError: Failed to link myclient/faults/FaultPojo (Module "deployment.myapp.ear:main" from Service Module Loader)

          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

          at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

          at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

          at org.jboss.modules.Module.loadModuleClass(Module.java:517)

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

          at myclient.SOAPIntegration.doSOAPCall(SOAPIntegration.java:247) [myclient.jar:]

          at mywebapp.servlet.Servlet.doGet(Servlet.java:411) [classes:]

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

          at myappAuthenticationFilter.replyAllowed(AuthenticationFilter.java:124) [classes:]

          at myapp.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:94) [classes:]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.10.Final.jar:]

          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.10.Final.jar:]

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.10.Final.jar:]

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.10.Final.jar:]

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.10.Final.jar:]

          at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_30]

      Caused by: java.lang.NoClassDefFoundError: org/apache/axis/AxisFault

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

          at java.lang.ClassLoader.defineClassCond(Unknown Source) [rt.jar:1.6.0_30]

          at java.lang.ClassLoader.defineClass(Unknown Source) [rt.jar:1.6.0_30]

          at java.security.SecureClassLoader.defineClass(Unknown Source) [rt.jar:1.6.0_30]

          at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

          ... 32 more

      Caused by: java.lang.ClassNotFoundException: org.apache.axis.AxisFault from [Module "deployment.myapp.ear:main" from Service Module Loader]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

          ... 38 more

       

       

            I solved this problem by adding web module definition under <deployment> tag of jboss-deplyment-structure.xml:

      <module name="deployment.myapp.ear.myweb3.war" />. myweb3 module is the one from which the servlet calls the soap client implementation.

       


      <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

      <deployment>


      <exclusions>



      <module name="org.apache.log4j" />


      </exclusions>


      <dependencies>



      <module name="org.apache.xerces" />



      <module name="org.apache.xalan" />



      <module name="deployment.myapp.ear.myweb3.war" />


      </dependencies>


      <resources>


      </resources>

      </deployment>

       

       

      Can anyone help me explain what did I achieve by adding web module dependency  to <deployment> section. Does this mean that the classloader of EAR/lib module will now see classloader of web module? What this action gave in terms of classloading and visibility of classes bewteen modules? It definetely help to solve the problem but I want to draw some conclusions from

      this. Thanks!