10 Replies Latest reply on Dec 20, 2010 3:23 AM by Sandra T

    JBoss 6.0.0.M5 spring and cxf problem

    Sandra T Newbie

      Hello,
      When I deploy my war in jboss 6.0.0.M5 I have the following error:

       

      Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationListener
          at java.net.URLClassLoader$1.run(URLClassLoader.java:200) [:1.6.0_16]
          at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_16]
          at java.net.URLClassLoader.findClass(URLClassLoader.java:188) [:1.6.0_16]
          at java.lang.ClassLoader.loadClass(ClassLoader.java:307) [:1.6.0_16]
          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) [:1.6.0_16]
          at java.lang.ClassLoader.loadClass(ClassLoader.java:252) [:1.6.0_16]
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) [:1.6.0_16]
          at java.lang.Class.forName0(Native Method) [:1.6.0_16]
          at java.lang.Class.forName(Class.java:247) [:1.6.0_16]
          at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:284) [jboss-classloader.jar:2.2.0.Alpha8]
          at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1152) [jboss-classloader.jar:2.2.0.Alpha8]
          at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:886) [jboss-classloader.jar:2.2.0.Alpha8]
          at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:505) [jboss-classloader.jar:2.2.0.Alpha8]
          at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:450) [jboss-classloader.jar:2.2.0.Alpha8]
          at java.lang.ClassLoader.loadClass(ClassLoader.java:252) [:1.6.0_16]
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) [:1.6.0_16]


      My jboss-classloading.xml:


      <?xml version="1.0" encoding="UTF-8"?>
      <classloading xmlns="urn:jboss:classloading:1.0"
          name="myApp.war"
          domain="myApp.war.domain"
          parent-domain="DefaultDomain"
          export-all="NON_EMPTY"
          import-all="true">
      </classloading>

      The spring jars (version 3.0.4) and cxf-bundle-minimal (version 2.2.11)  are in WEB-INF/lib

       

      Do I need to configure anything else? Did I miss something to do?

      Thanks in advance for your help.

       

      Sandra

        • 1. Re: JBoss 6.0.0.M5 spring and cxf problem
          Adrien Ruffie Newbie

          Hello Sandra, can you provide more informations ?

          • 2. Re: JBoss 6.0.0.M5 spring and cxf problem
            Ales Justin Master

            My guess is that you actually hit CXF classes from JBoss' libs.

            And then those classes don't see your Spring classes, as they are in you war.

             

            Perhaps place spring.jar into JBoss' lib dir?

            Or you'll need to get past the cxf lib issue some other way; e.g. jboss-classloading-domain.xml.

            • 3. Re: JBoss 6.0.0.M5 spring and cxf problem
              Sandra T Newbie

              The spring jars are in my war. When I deploy my webapp in JBoss 5.1, it works fine. What are the differences between JBoss 5.1 and JBoss 6.M5 ?

              • 4. Re: JBoss 6.0.0.M5 spring and cxf problem
                Ales Justin Master

                When I deploy my webapp in JBoss 5.1, it works fine. What are the differences between JBoss 5.1 and JBoss 6.M5 ?

                Afaik, AS6 already ships cxf.

                Hence the classes are loaded from jboss lib --> no war visibility.

                • 5. Re: JBoss 6.0.0.M5 spring and cxf problem
                  Alessio Soldano Master

                  Right, jboss AS 6 comes with jbossws-cxf installed, hence the cxf libs are already available among jboss lib. You shouldn't include them in your war.

                  Can you try removing them from the war and also moving the spring jars together with the other jboss lib?

                  • 6. Re: JBoss 6.0.0.M5 spring and cxf problem
                    Sandra T Newbie

                    when I move spring jars in repository with other jboss lib, I have this error :

                    java.lang.RuntimeException: mapped-name is required for MyManager of deployment myApp.war.

                     

                    I replaced jboss-classloading.xml with jboss-classloading-domain.xml and I have the following error :

                    Caused by: java.lang.Error: Error visiting  "/home/sandraT/Logiciels/jboss-6.0.0.20100911-M5/server/default/deploy/myApp.war/WEB-INF/lib/xmlbeans-2.4.0.jar/org/apache/xmlbeans/impl/store/Xobj$DetailEntryXobj.class"
                         at  org.jboss.classloading.plugins.vfs.VFSResourceVisitor.visit(VFSResourceVisitor.java:268)  [jboss-classloading-vfs.jar:2.2.0.Alpha8]
                         at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:407) [jboss-vfs.jar:3.0.0.CR5]
                         at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5]
                         at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5]
                         at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5]
                         at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5]
                         at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5]
                         at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:395) [jboss-vfs.jar:3.0.0.CR5]
                         at  org.jboss.classloading.plugins.vfs.VFSResourceVisitor.visit(VFSResourceVisitor.java:102)  [jboss-classloading-vfs.jar:2.2.0.Alpha8]
                         at  org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.visit(VFSDeploymentClassLoaderPolicyModule.java:181)  [:2.2.0.Alpha7]
                         at org.jboss.scanning.plugins.DeploymentUnitScanner.scan(DeploymentUnitScanner.java:111) [:1.0.0.Alpha6]
                         at org.jboss.scanning.spi.helpers.UrlScanner.scan(UrlScanner.java:96) [:1.0.0.Alpha6]
                         at org.jboss.scanning.deployers.ScanningDeployer.deploy(ScanningDeployer.java:90) [:1.0.0.Alpha6]
                         at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.Alpha7]
                         ... 37 more
                    Caused by: java.lang.RuntimeException: Error visiting resource:  VFSResourceContext @  org/apache/xmlbeans/impl/store/Xobj$DetailEntryXobj.class /  BaseClassLoader@14ee9dd{vfs:///home/sandraT/Logiciels/jboss-6.0.0.20100911-M5/server/default/deploy/myApp.war},  visitor:  org.jboss.scanning.annotations.plugins.GenericAnnotationVisitor@810bca
                         at org.jboss.scanning.plugins.visitor.IgnoreSetErrorHandler.handleError(IgnoreSetErrorHandler.java:56) [:1.0.0.Alpha6]
                         at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.visit(ReflectResourceVisitor.java:91) [:1.0.0.Alpha6]
                         at org.jboss.scanning.annotations.plugins.AnnotationsScanningPlugin.visit(AnnotationsScanningPlugin.java:89) [:1.0.0.Alpha6]
                         at org.jboss.scanning.spi.helpers.ScanningPluginWrapper.visit(ScanningPluginWrapper.java:112) [:1.0.0.Alpha6]
                         at  org.jboss.classloading.plugins.visitor.FederatedResourceVisitor.visit(FederatedResourceVisitor.java:101)  [jboss-classloading.jar:2.2.0.Alpha8]
                         at  org.jboss.classloading.plugins.vfs.VFSResourceVisitor.visit(VFSResourceVisitor.java:264)  [jboss-classloading-vfs.jar:2.2.0.Alpha8]
                         ... 50 more
                    Caused by: java.lang.LinkageError: loader constraint violation in  interface itable initialization: when resolving method  "org.apache.xmlbeans.impl.store.Xobj$ElementXobj.getSchemaTypeInfo()Lorg/w3c/dom/TypeInfo;"  the class loader (instance of  org/jboss/classloader/spi/base/BaseClassLoader) of the current class,  org/apache/xmlbeans/impl/store/Xobj$ElementXobj, and the class loader  (instance of <bootloader>) for interface org/w3c/dom/Element have  different Class objects for the type org/w3c/dom/TypeInfo used in the  signature
                         at java.lang.Class.getDeclaredConstructors0(Native Method) [:1.6.0_23]
                         at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) [:1.6.0_23]
                         at java.lang.Class.getDeclaredConstructors(Class.java:1836) [:1.6.0_23]
                         at  org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getDeclaredConstructors(IntrospectionTypeInfoFactoryImpl.java:559)  [jboss-reflect.jar:2.2.0.Alpha9]
                         at  org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getConstructors(IntrospectionTypeInfoFactoryImpl.java:158)  [jboss-reflect.jar:2.2.0.Alpha9]
                         at org.jboss.reflect.plugins.ClassInfoImpl.getDeclaredConstructors(ClassInfoImpl.java:446) [jboss-reflect.jar:2.2.0.Alpha9]
                         at  org.jboss.scanning.plugins.visitor.ClassHierarchyResourceVisitor.handleClass(ClassHierarchyResourceVisitor.java:79)  [:1.0.0.Alpha6]
                         at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.doVisit(ReflectResourceVisitor.java:108) [:1.0.0.Alpha6]
                         at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.visit(ReflectResourceVisitor.java:86) [:1.0.0.Alpha6]
                         ... 54 more

                     

                    I think my jboss-classloading-domain.xml isn't correctly configured :

                    <classloading-domain xmlns="urn:jboss:classloading-domain:1.0" name="myApp.war-domaine">
                        <parent-policy>
                           <before-filter>
                              <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.classloader.plugins.filter.NegatingClassFilter">
                                 <constructor>
                                    <parameter>
                                       <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.classloader.spi.filter.PackageClassFilter">
                                          <constructor>
                                             <parameter>org.apache.cxf,org.apache.xmlbeans,org.ow3c.dom</parameter>
                                          </constructor>
                                       </javabean>
                                    </parameter>
                                 </constructor>
                              </javabean>
                           </before-filter>
                        </parent-policy>
                    </classloading-domain>

                     

                    Thanks in advance for your help.

                     

                    Sandra

                    • 7. Re: JBoss 6.0.0.M5 spring and cxf problem
                      Alessio Soldano Master

                      Could you clarify to me what do you need the jboss-classloading declaration for?

                      • 8. Re: JBoss 6.0.0.M5 spring and cxf problem
                        Sandra T Newbie

                        When I don't define jboss-classloading, I have an error with xmlbeans (the same as in my previous message)

                        • 9. Re: JBoss 6.0.0.M5 spring and cxf problem
                          Alessio Soldano Master

                          mmh... my guess is that there're still libs in your deployment that override stuff in the application server while they should not.

                           

                          That's most probably not the problem, but note you wrote "org.ow3c.dom" instead of "org.w3c.dom" in the parameter element above.

                          • 10. Re: JBoss 6.0.0.M5 spring and cxf problem
                            Sandra T Newbie

                            Hi,

                            Whatever the configuration used, I can't deploy my webapp. I don't understand what is wrong with my configurations.

                            If anyone has another solution, he doesn't hesitate to propose.

                            Thanks for your help.

                             

                            Sandra