1 Reply Latest reply on Nov 30, 2007 1:15 AM by jaikiran

    org.apache.commons.logging.impl.Log4JLogger does not impleme

      I am working on adding a new jsf enabled .war project to an existing .ear application that is deployed to jboss 3.2.6. I have the basic helloworld jsf project (using icefaces) working if I deploy it to jboss outside of the ear, but when I include it in the ear I get the "Log4JLogger does not implement Log"

      If I remove the commons-logging.jar from my jsf.war and deploy within the .ear then the error for Log4JLogger goes away but I get an "Exception processing TLD at resource path /WEB-INF/jsf_core.tld in context..."

      The other war files in the ear are in fact using log4j and the conf/log4.xml exists and the mbean is configured for the org.jboss.logging.Log4jService in the jboss-service.xml.

      Here are the jars with log in their name (custom is the server name we start jboss with):
      [root@beta server]# find . -name "*.jar" | grep log
      ./custom/deploy/jbossweb-tomcat50.sar/commons-logging.jar
      ./custom/lib/log4j-1.2.13.jar
      ./minimal/lib/log4j-1.2.13.jar
      ./all/deploy/jboss-net.sar/commons-logging.jar
      ./all/deploy/jbossweb-tomcat50.sar/commons-logging.jar
      ./all/lib/log4j-1.2.13.jar
      ./all/lib/commons-logging.jar
      ./default/deploy/jbossweb-tomcat50.sar/commons-logging.jar
      ./default/lib/log4j-1.2.13.jar

      Trace when logging-commons.jar is in the cpWeb.war/WEB-INF/lib:

      09:28:39,593 ERROR [BaseModelMBean] Error creating class org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log
      09:28:39,609 ERROR [WebModule] Starting failed jboss.web.deployment:war=cpWeb.war,id=1120249471
      org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (javax.management.ReflectionException: Cannot find setter method setDocBase null)
      at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:329)
      at org.jboss.web.WebModule.startModule(WebModule.java:62)
      at org.jboss.web.WebModule.startService(WebModule.java:40)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
      at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:884)
      at $Proxy18.start(Unknown Source)


      Trace when the logging-commons is removed from the cpWeb.war/WEB-INF/lib:


      09:42:06,687 ERROR [Context] Error reading tld listeners javax.servlet.ServletException: Exception processing TLD at resource path /WEB-INF/jsf_core.tld in context /cpWeb
      javax.servlet.ServletException: Exception processing TLD at resource path /WEB-INF/jsf_core.tld in context /cpWeb
      at org.apache.catalina.startup.TldConfig.tldScanTld(TldConfig.java:549)
      at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:301)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4282)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)

        • 1. Re: org.apache.commons.logging.impl.Log4JLogger does not imp
          jaikiran

           

          but when I include it in the ear I get the "Log4JLogger does not implement Log"


          Looks like a classloading issue. JBoss already has the commons-logging.jar in it's server lib folder. Since your application too includes it, the classes get loaded from 2 different classloaders. Removing the commons-logging.jar from your application is the easiest way to get rid of this exception.

          If I remove the commons-logging.jar from my jsf.war and deploy within the .ear then the error for Log4JLogger goes away but I get an "Exception processing TLD at resource path /WEB-INF/jsf_core.tld in context..."


          This exception might be because of some other reason.

          Trace when the logging-commons is removed from the cpWeb.war/WEB-INF/lib:

          09:42:06,687 ERROR [Context] Error reading tld listeners javax.servlet.ServletException: Exception processing TLD at resource path /WEB-INF/jsf_core.tld in context /cpWeb
          javax.servlet.ServletException: Exception processing TLD at resource path /WEB-INF/jsf_core.tld in context /cpWeb
          at org.apache.catalina.startup.TldConfig.tldScanTld(TldConfig.java:549)
          at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:301)
          at org.apache.catalina.core.StandardContext.start(StandardContext.java:4282)
          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)


          Is that tld file available at that location? Is this all you get in the exception stacktrace? If there's more to the stacktrace then post the entire thing here.