5 Replies Latest reply on Apr 8, 2015 1:37 PM by James Perkins

    JBoss AS 7.1.1.Final - java.lang.ClassNotFoundException: org.apache.commons.logging.Log

    Tomáš Pekař Newbie

      Hi,

       

      I was installed JOSSO 1.8.9 to the JBoss AS 7.1.1.Final. Installation of JOSSO gateway and JOSSO agent looks ok with known issues for examle from this :

      http://codepk.tumblr.com/post/101409947356/josso-agent-1-8-installation-in-jboss-7-1.

      I have problem with starting of the josso-partner-jboss7-app-1.8.9.ear which is example of applications used JOSSO sso. On the deploy this error appears:

       

      14:41:10,998 WARN  [org.jboss.modules] (MSC service thread 1-4) Failed to define class org.apache.commons.logging.Log in Module "org.slf4j.jcl-over-slf4j:main" from local module loader @625eb12e (roots: D:\Projects\jboss-as-7.1.1.Final\modules): java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "org/apache/commons/logging/Log"

          at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_75]

          at java.lang.ClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0_75]

          at java.security.SecureClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0_75]

          at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) [jboss-modules.jar:1.1.1.GA]

          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) [jboss-modules.jar:1.1.1.GA]

          at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) [jboss-modules.jar:1.1.1.GA]

          at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.1.1.GA]

          at org.jboss.modules.Module.loadModuleClass(Module.java:517) [jboss-modules.jar:1.1.1.GA]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) [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]

          at org.apache.commons.logging.LogFactory.<clinit>(LogFactory.java:40) [jcl-over-slf4j-1.6.1.jar:1.6.1]

          at org.josso.agent.Lookup.<clinit>(Lookup.java:42) [josso-agents-bin-1.8.9-jaxws.jar:]

          at org.josso.jb7.agent.JOSSOJASPIAuthenticator.<init>(JOSSOJASPIAuthenticator.java:63) [josso-jboss7-agent-1.8.9.jar:1.8.9]

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_75]

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.7.0_75]

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.7.0_75]

          at java.lang.reflect.Constructor.newInstance(Unknown Source) [rt.jar:1.7.0_75]

          at java.lang.Class.newInstance(Unknown Source) [rt.jar:1.7.0_75]

          at org.jboss.as.web.deployment.WarDeploymentProcessor.getInstance(WarDeploymentProcessor.java:378)

          at org.jboss.as.web.deployment.WarDeploymentProcessor.processDeployment(WarDeploymentProcessor.java:210)

          at org.jboss.as.web.deployment.WarDeploymentProcessor.deploy(WarDeploymentProcessor.java:114)

          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(Unknown Source) [rt.jar:1.7.0_75]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_75]

          at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_75]

       

      14:41:11,057 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.subunit."josso-partner-jboss7-app-1.8.9.ear"."josso-partner-jboss7-web-1.8.9.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."josso-partner-jboss7-app-1.8.9.ear"."josso-partner-jboss7-web-1.8.9.war".INSTALL: Failed to process phase INSTALL of subdeployment "josso-partner-jboss7-web-1.8.9.war" of deployment "josso-partner-jboss7-app-1.8.9.ear"

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [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(Unknown Source) [rt.jar:1.7.0_75]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_75]

          at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_75]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018096: Error instantiating container component: org.josso.jb7.agent.JOSSOJASPIAuthenticator

          at org.jboss.as.web.deployment.WarDeploymentProcessor.getInstance(WarDeploymentProcessor.java:386)

          at org.jboss.as.web.deployment.WarDeploymentProcessor.processDeployment(WarDeploymentProcessor.java:210)

          at org.jboss.as.web.deployment.WarDeploymentProcessor.deploy(WarDeploymentProcessor.java:114)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          ... 5 more

      Caused by: java.lang.NoClassDefFoundError: org/apache/commons/logging/Log

          at org.apache.commons.logging.LogFactory.<clinit>(LogFactory.java:40) [jcl-over-slf4j-1.6.1.jar:1.6.1]

          at org.josso.agent.Lookup.<clinit>(Lookup.java:42) [josso-agents-bin-1.8.9-jaxws.jar:]

          at org.josso.jb7.agent.JOSSOJASPIAuthenticator.<init>(JOSSOJASPIAuthenticator.java:63) [josso-jboss7-agent-1.8.9.jar:1.8.9]

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_75]

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.7.0_75]

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.7.0_75]

          at java.lang.reflect.Constructor.newInstance(Unknown Source) [rt.jar:1.7.0_75]

          at java.lang.Class.newInstance(Unknown Source) [rt.jar:1.7.0_75]

          at org.jboss.as.web.deployment.WarDeploymentProcessor.getInstance(WarDeploymentProcessor.java:378)

          ... 8 more

      Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.Log from [Module "org.slf4j.jcl-over-slf4j:main" from local module loader @625eb12e (roots: D:\Projects\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]

          ... 17 more

       

      It takes no sense to me. This is module.xml from /jboss-as-7.1.1.Final/modules/org/apache/commons/loging/main/

       

      <?xml version="1.0" encoding="UTF-8"?>
      <module-alias xmlns="urn:jboss:module:1.1" name="org.apache.commons.logging" target-name="org.slf4j.jcl-over-slf4j"/>
      

       

      So commons logging using implementation from slf4j.

      Here is module.xml of org.slf4j.jcl-over-slf4j module:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <module xmlns="urn:jboss:module:1.1" name="org.slf4j.jcl-over-slf4j">
          <resources>
              <resource-root path="jcl-over-slf4j-1.6.1.jar"/>
              <!-- Insert resources here -->
          </resources>
      
          <dependencies>
              <module name="org.slf4j"/>
          </dependencies>
      </module>
      

       

      and in jcl-over-slf4j-1.6.1.jar is visible org.apache.commons.logging.Log class.

       

      It is problem with class loading with EAR? How can I fix it? Many thanks for any help.