2 Replies Latest reply on Feb 3, 2016 2:42 AM by suparna1

    EAP6.4.0 EAR lib cannot resolve dependency on WAR lib, works in WAS 7

    suparna1

      We are migrating our (Spring 2.5.6) application from WAS 7 to Jboss EAP 6.4.0. It has the following structure :

      MyEAR

         |------lib

                |----spring-security-core.jar

         |------META-INF

                     |-------application.xml

                     |------MANIFEST.MF

         |------MyWAR

                     |-------WebContent

                                |-------WEB-INF

                                           |------lib

                                                  |---------spring-core.jar

                                                  |---------spring-context.jar

                                                  |---------spring-beans.jar

                                |-------META-INF

                                          |------MANIFEST.MF


      The WAR MANIFEST has Class-Path: entries for spring-security-core jar.

      While loading the application, the EAR throws Linkage Error (condensed) :

      Failed to define class org.springframework.security.SpringSecurityException in Module "deployment.MyEAR.ear:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/springframework/security/SpringSecurityException (Module "deployment.MyEAR.ear:main" from Service Module Loader)

      Caused by: java.lang.NoClassDefFoundError: org/springframework/core/NestedRuntimeException

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

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

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

        at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:361) [jboss-modules.jar:1.3.6.Final-redhat-1]

        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482) [jboss-modules.jar:1.3.6.Final-redhat-1]

        ... 38 more

       

      Seems like the SpringSecurityException defined in spring-security-core.jar has an import of 'org.springframework.core.NestedRuntimeException' which in turn is defined in the spring-core.jar included in the WAR lib, but is unable to find it.Is there a reason why the EAR libs cannot find the WEB-INF / lib ones ? This works perfectly fine in WAS 7.