3 Replies Latest reply on Jul 3, 2014 4:43 AM by Shaswat Parikh

    Getting WARN for AbstractTestNGSpringContextTests LinkageError

    Shaswat Parikh Newbie

      Hello All,

       

      I am facing below warnning while i deploy my application into WildFly. Please find error log and deployment.xml as mention below respectively.

       

      19:57:54,774 WARN  [org.jboss.modules] (default task-34) Failed to define class org.springframework.test.context.testng.AbstractTestNGSpringContextTests in Module "deployment.shs.war:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/springframework/test/context/testng/AbstractTestNGSpringContextTests (Module "deployment.shs.war:main" from Service Module Loader)
          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:487) [jboss-modules.jar:1.3.3.Final]
          at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:277) [jboss-modules.jar:1.3.3.Final]
          at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:92) [jboss-modules.jar:1.3.3.Final]
          at org.jboss.modules.Module.loadModuleClass(Module.java:568) [jboss-modules.jar:1.3.3.Final]
          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205) [jboss-modules.jar:1.3.3.Final]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
          at com.opensymphony.xwork2.util.finder.ClassLoaderInterfaceDelegate.loadClass(ClassLoaderInterfaceDelegate.java:34) [xwork-core-2.3.16.2.jar:2.3.16.2]
          at com.opensymphony.xwork2.util.finder.ClassFinder$ClassInfo.get(ClassFinder.java:562) [xwork-core-2.3.16.2.jar:2.3.16.2]
          at org.apache.struts2.convention.PackageBasedActionConfigBuilder$3.test(PackageBasedActionConfigBuilder.java:620) [struts2-convention-plugin-2.3.16.2.jar:2.3.16.2]
          at org.apache.struts2.convention.PackageBasedActionConfigBuilder$3.test(PackageBasedActionConfigBuilder.java:607) [struts2-convention-plugin-2.3.16.2.jar:2.3.16.2]
          at com.opensymphony.xwork2.util.finder.ClassFinder.findClasses(ClassFinder.java:342) [xwork-core-2.3.16.2.jar:2.3.16.2]
          at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:393) [struts2-convention-plugin-2.3.16.2.jar:2.3.16.2]
          at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:347) [struts2-convention-plugin-2.3.16.2.jar:2.3.16.2]
          at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53) [struts2-convention-plugin-2.3.16.2.jar:2.3.16.2]
          at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:268) [xwork-core-2.3.16.2.jar:2.3.16.2]
          at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67) [xwork-core-2.3.16.2.jar:2.3.16.2]
          at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:445) [struts2-core-2.3.16.2.jar:2.3.16.2]
          at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:489) [struts2-core-2.3.16.2.jar:2.3.16.2]
          at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74) [struts2-core-2.3.16.2.jar:2.3.16.2]
          at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.init(StrutsPrepareFilter.java:56) [struts2-core-2.3.16.2.jar:2.3.16.2]
          at io.undertow.servlet.core.ManagedFilter.createFilter(ManagedFilter.java:79) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.core.ManagedFilter.getFilter(ManagedFilter.java:65) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at com.homeservices.admin.DomainFilter.doFilter(DomainFilter.java:29) [classes:]
          at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at org.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:50) [cas-client-core-3.1.6.jar:]
          at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167) [cas-client-core-3.1.6.jar:]
          at com.homeservices.web.sso.ShsCasValidationFilter.doFilter(ShsCasValidationFilter.java:38) [classes:]
          at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at com.homeservices.web.sso.ShsAuthenticationFilter.doFilter(ShsAuthenticationFilter.java:71) [classes:]
          at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at com.homeservices.web.ScrapperMonitoringFilter.doFilter(ScrapperMonitoringFilter.java:41) [classes:]
          at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at com.homeservices.admin.ServletAttackFilter.doFilter(ServletAttackFilter.java:31) [classes:]
          at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at com.homeservices.web.ShsEnvironmentFilter.doFilter(ShsEnvironmentFilter.java:35) [classes:]
          at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at org.jsonp.JsonpFilter.doFilter(JsonpFilter.java:96) [classes:]
          at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
          at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
          at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
          at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
      Caused by: java.lang.NoClassDefFoundError: org/testng/IHookable
          at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_51]
          at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [rt.jar:1.7.0_51]
          at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:361) [jboss-modules.jar:1.3.3.Final]
          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482) [jboss-modules.jar:1.3.3.Final]
          ... 77 more
      Caused by: java.lang.ClassNotFoundException: org.testng.IHookable from [Module "deployment.shs.war:main" from Service Module Loader]
          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
          ... 81 more
      

       

      <jboss-deployment-structure>
          <!-- Make sub deployments isolated by default, so they cannot see each others classes without a Class-Path entry -->
          <ear-subdeployments-isolated>true</ear-subdeployments-isolated>
          <!-- This corresponds to the top level deployment. For a war this is the war's module, for an ear -->
          <!-- This is the top level ear module, which contains all the classes in the EAR's lib folder     -->
          <deployment>
              <!-- exclude-subsystem prevents a subsystems deployment unit processors running on a deployment -->
              <!-- which gives basically the same effect as removing the subsystem, but it only affects single deployment -->
              <exclude-subsystems>
                  <subsystem name="resteasy"/>
                  <subsystem name="jaxrs"/>
                  <subsystem name="ejb3"/>
              </exclude-subsystems>
              <!-- Exclusions allow you to prevent the server from automatically adding some dependencies     -->
              <exclusions>
                  <module name="org.javassist" />
                  <module name="org.hibernate"/>
                  <module name="org.apache.log4j"/>
              </exclusions>
              <!-- This allows you to define additional dependencies, it is the same as using the Dependencies: manifest attribute -->
              <dependencies>
                  <module name="org.jboss.ws.cxf.jbossws-cxf-client"/>
              </dependencies>
              <!-- These add additional classes to the module. In this case it is the same as including the jar in the EAR's lib directory -->
              <resources>
                  <resource-root path="WEB-INF/lib/bcprov-jdk15on-150.jar" use-physical-code-source="true"/>
                  <resource-root path="WEB-INF/lib/bcprov-jdk16-143.jar" use-physical-code-source="true"/>
                  <resource-root path="WEB-INF/lib/bcpg-jdk15on-150.jar" use-physical-code-source="true"/>
                  <resource-root path="WEB-INF/lib/activation-1.1.jar" use-physical-code-source="true"/>
                  <resource-root path="WEB-INF/lib/concurrent.jar" use-physical-code-source="true"/>
                  <resource-root path="WEB-INF/lib/log4j-1.2.17.jar" use-physical-code-source="true"/>
                  <resource-root path="WEB-INF/lib/antlr-3.1.3.jar" use-physical-code-source="true"/>
                  <resource-root path="WEB-INF/lib/json-lib-2.3-jdk15.jar" use-physical-code-source="true"/>
                  <resource-root path="WEB-INF/lib/junit-4.8.2.jar" use-physical-code-source="true"/>
                  <resource-root path="WEB-INF/lib/spring-test-3.0.5.RELEASE.jar" use-physical-code-source="true"/>
                  <resource-root path="WEB-INF/lib/ezmorph-1.0.3.jar" use-physical-code-source="true"/>
              </resources>
          </deployment>
      </jboss-deployment-structure>
      

      I did try multiple ways resolve but yet not able to resolve the same. Please give me some hint to resolve the same.

        • 1. Re: Getting WARN for AbstractTestNGSpringContextTests LinkageError
          Tomaz Cerar Master

          Hi,

           

          you are complicating a bit aren't you?

           

          your jboss-deployment-structure.xml is suited for EAR file and not for WAR itself.

           

          Problem you have is that you are missing testng-xx.jar in your deployment.

          Which looks like a bug by itself to have testing framework as part of runtime deployment.

           

          you should probably remove spring-test-3.0.5.RELEASE.jar from your deployment and you should be fine.


          also i think you should be completly fine with just this in jboss-deployment-structure.xml


          <jboss-deployment-structure> 
              <deployment> 
                  <exclude-subsystems> 
                      <subsystem name="resteasy"/> 
                      <subsystem name="jaxrs"/> 
                      <subsystem name="ejb3"/> 
                  </exclude-subsystems> 
                  <exclusions> 
                      <module name="org.javassist" /> 
                      <module name="org.hibernate"/> 
                      <module name="org.apache.log4j"/> 
                  </exclusions> 
                  <dependencies> 
                      <module name="org.jboss.ws.cxf.jbossws-cxf-client"/> 
                  </dependencies> 
              </deployment> 
          </jboss-deployment-structure>
          

           

           

          or even without it...

           

          if you still have problems after you removed spring-test, post contents of WEB-INF/lib

          • 2. Re: Getting WARN for AbstractTestNGSpringContextTests LinkageError
            Shaswat Parikh Newbie

            Hello,

             

            Thanks for your response. I try it after removing resource-root entry from deployment.xml, still i am facing that WARN.

             

            Please find the snapshot of WEB_INF/lib as,

            WEB_INF-lib.png

            My war gets deploy properly but once i hit my site, i got the mention WARN.

            • 3. Re: Getting WARN for AbstractTestNGSpringContextTests LinkageError
              Shaswat Parikh Newbie

              Thanks    Tomaz Cerar Issues resolved. I removed that test jar from WEB_INF/lib and it works.