0 Replies Latest reply on Jun 12, 2015 3:25 PM by sanjay05222

    JBoss 7.1.1 & CXF & Spring Class loading issue. ?

    sanjay05222

      Hi Guys

       

      I have this web application which has this SOAP CXF services using spring. The war use work fine in Wildfly 8.2.0 for some reason same jar is not working in JBoss 7.1.1 , When I Deploy the jar I see below error.

      Generally   what I am doing is that I am trying to use cxf module which comes default with the JBoss 7.1.1 and putting Spring Jars inside the WEB-INF/lib and decided to declare the cxf module in jboss-deployment-structure file as shown below.

      Looks like that there is a issue in class loading although the spring classes get loaded from the war but when it tries to load the CXF classess and it comes backs and looks for ApplicationContext it say class not found. very wierd behaviour or I totally didnt understand the module class loading phenomena its really still sucks I don't know why.

      I can solve this issue by createing a modules and putting all the jar out there and declaring it , this not what I want to do actually I want to pack everything in the war , but the issue is that the exclusion of CXF jars doesnt not work I tried updateing the marhseller as well but not able to exclude the CXF modules already come out of the box from the JBOSS

       

      Deployment Details and Observations

      ClassIssue.png

       

      Error Details 

      11:41:08,776 DEBUG [org.jboss.as.ee] (MSC service thread 1-4) Configuring component class: org.apache.taglibs.standard.tag.rt.xml.ExprTag named org.apache.taglibs.standard.tag.rt.xml.ExprTag

      11:41:08,799 DEBUG [org.jboss.as.ee] (MSC service thread 1-4) Configuring component class: org.springframework.web.servlet.tags.form.FormTag named org.springframework.web.servlet.tags.form.FormTag

      11:41:08,806 DEBUG [org.jboss.as.ee] (MSC service thread 1-4) Configuring component class: org.apache.cxf.transport.servlet.CXFServlet named org.apache.cxf.transport.servlet.CXFServlet

      11:41:08,819 WARN  [org.jboss.as.ee] (MSC service thread 1-4) JBAS011006: Not installing optional component org.apache.cxf.transport.servlet.CXFServlet due to exception: java.lang.RuntimeException: Error getting reflective information for class org.apache.cxf.transport.servlet.CXFServlet with ClassLoader ModuleClassLoader for Module "org.apache.cxf:main" from local module loader @46e337b2 (roots: E:\Dev-Home\jbpm-6.2.0.Final-installer-full\jboss-as-7.1.1.Final\modules)

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

        at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:569)

        at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)

        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.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.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_71]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_71]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]

      Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext

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

        at java.lang.Class.privateGetDeclaredFields(Class.java:2499) [rt.jar:1.7.0_71]

        at java.lang.Class.getDeclaredFields(Class.java:1811) [rt.jar:1.7.0_71]

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

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

        ... 8 more

      Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext from [Module "org.apache.cxf:main" from local module loader @46e337b2 (roots: E:\Dev-Home\jbpm-6.2.0.Final-installer-full\jboss-as-7.1.1.Final\modules)]

        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.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]

        ... 13 more

       

       

      11:41:08,988 DEBUG [org.jboss.as.ee] (MSC service thread 1-4) Configuring component class: org.apache.taglibs.standard.tag.rt.fmt.ParamTag named org.apache.taglibs.standard.tag.rt.fmt.ParamTag