5 Replies Latest reply on Feb 13, 2009 11:26 AM by Peter Johnson

    War file produces org.apache.commons.logging.LogConfiguratio

    gaurav sharma Newbie

      I am trying to deploy a web application on JBoss 4.2.2. This is part of the Eclipse project (the infocenter user assistance system) . I have to support JBoss 4.2.2 though.

      The web application works perfectly under JBoss jboss-4.0.4.GA but showing the errors when running on jboss 4.2.2 and the trace of error is below.
      I have seen the solutions pasted by some users but none of them is helping.
      any help would be good...


      Trace is


      org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@10cecb2 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@10cecb2 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category))
      org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
      org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
      org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
      org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
      org.apache.jasper.servlet.JspServlet.(JspServlet.java:58)
      org.eclipse.equinox.jsp.jasper.JspServlet.(JspServlet.java:65)
      org.eclipse.equinox.jsp.jasper.registry.JSPFactory.create(JSPFactory.java:56)
      org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:262)
      org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
      org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.initializeDelegate(ServletManager.java:194)
      org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:179)
      org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
      org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
      org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:75)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.eclipse.equinox.servletbridge.BridgeServlet.service(BridgeServlet.java:121)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


      root cause

      org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@10cecb2 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)
      org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)
      org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
      org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
      org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
      org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
      org.apache.jasper.servlet.JspServlet.(JspServlet.java:58)
      org.eclipse.equinox.jsp.jasper.JspServlet.(JspServlet.java:65)
      org.eclipse.equinox.jsp.jasper.registry.JSPFactory.create(JSPFactory.java:56)
      org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:262)
      org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
      org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.initializeDelegate(ServletManager.java:194)
      org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:179)
      org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
      org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
      org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:75)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.eclipse.equinox.servletbridge.BridgeServlet.service(BridgeServlet.java:121)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


      root cause

      java.lang.NoClassDefFoundError: org/apache/log4j/Category
      java.lang.Class.getDeclaredConstructors0(Native Method)
      java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
      java.lang.Class.getConstructor0(Unknown Source)
      java.lang.Class.getConstructor(Unknown Source)
      org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
      org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
      org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
      org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
      org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
      org.apache.jasper.servlet.JspServlet.(JspServlet.java:58)
      org.eclipse.equinox.jsp.jasper.JspServlet.(JspServlet.java:65)
      org.eclipse.equinox.jsp.jasper.registry.JSPFactory.create(JSPFactory.java:56)
      org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:262)
      org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
      org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.initializeDelegate(ServletManager.java:194)
      org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:179)
      org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
      org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
      org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:75)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.eclipse.equinox.servletbridge.BridgeServlet.service(BridgeServlet.java:121)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


        • 1. Re: War file produces org.apache.commons.logging.LogConfigur
          Peter Johnson Master

          Do you package either the commons logging of log4j jar file in your web app? If so, remove them.

          • 2. Re: War file produces org.apache.commons.logging.LogConfigur
            gaurav sharma Newbie

            Thanks peterj , for the reply.

            Actually i am using eclipse Infocenter .WAR and there are minimal number of jars which are required to run this application and one of the jar used is
            org.apache.commons.logging_1.0.4.v20080605-1930.jar. If i am removing this jar from the app ,the application is not running even on jboss 4.0.4.

            As per your reply , I tried removing the jar from the application and then tried running it on jboss 4.4.2 GA .
            the error which is comming up is


            HTTP Status 404 - ProxyServlet: /help/

            --------------------------------------------------------------------------------

            type Status report

            message ProxyServlet: /help/

            description The requested resource (ProxyServlet: /help/) is not available.


            --------------------------------------------------------------------------------




            and when removing commons jar from application and adding the commons jar of jboss 4.2.2 in tha application the error pasted above is not comming but , the trace comming up is similar to the one posted in my last post.

            • 3. Re: War file produces org.apache.commons.logging.LogConfigur
              Peter Johnson Master

              Error messages in the browser rarely help - post the stack trace from the console log instead. So I have no idea of what the error is - it could be a problem within the application itself and nothing at all related to JBoss AS.

              • 4. Re: War file produces org.apache.commons.logging.LogConfigur
                gaurav sharma Newbie

                Thanks for the reply Peter.

                I tried looking in the server log but could not find any thing there.When I am trying your suggested solution browser is showing 404 error but nothing could be seen in console or log.
                I tried looking in the jboss console but no error could be seen even there.

                What i did is i took the commons.logging jar of my application and jboss 4.0.4 commons logging and found that jar is similar and application is running perfectly fine.
                Then I took commons.logging of my application and commons.logging of jboss 4.2.2 and I could make that there is lot of difference between the two and that is the cause I think , and on running the application the error pasted in my first post is comming up.

                When I am removing the commons.logging of jboss4.2.2 the server is showing error in starting and when I am removing the commons.logging of my application then this 404 error is comming.I think this commons.logging is must for my application as when I am removing this jar from my application and then running the application in jboss4.0.4 then also this 404 error is comming up.


                Could you guide me how can I overcome this problem.
                any help would be highly appreciated.

                • 5. Re: War file produces org.apache.commons.logging.LogConfigur
                  Peter Johnson Master

                  Do not remove commons-logging from JBoss AS - leave it there! Only remove the one in your app.