Uploaded image for project: 'Forrest'
  1. Forrest
  2. FOR-1049

Forrest war is crashing apache-tomcat-5.5.23 upon restart

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Launch servlet WAR
    • Labels:
      None

      Description

      http://www.mail-archive.com/user@forrest.apache.org/msg00779.html
      "I'm having some problems with the present svn head (two days old): the war it creates installes fine in Tomcat when deployed through Tomcat's HTML Manager, and as long as Tomcat is running without interruption, there's no problem. But when restarted, Tomcat crashes severely. This happens only when the Forrest war is installed, without the Forrest war, there is no problem.

      Config:
      - (almost) latest Forrest svn
      - Tomcat 5.5.9
      - Java 1.5_02
      - Win2k server"

      I am seeing the same issue on an ubuntu linux.

        Activity

        Show
        thorsten Thorsten Scherler added a comment - http://servlets.com/archive/servlet/ReadMsg?msgId=484982&listName=tomcat-user
        Hide
        thorsten Thorsten Scherler added a comment -
        http://www.opensubscriber.com/message/users@cocoon.apache.org/4379659.html -> tip from Antonio "The problem seems to be an older commons-logging-jar in your classpath"
        Show
        thorsten Thorsten Scherler added a comment - http://www.opensubscriber.com/message/users@cocoon.apache.org/4379659.html -> tip from Antonio "The problem seems to be an older commons-logging-jar in your classpath"
        Show
        thorsten Thorsten Scherler added a comment - http://osdir.com/ml/text.xml.forrest.user/2006-02/msg00100.html More related threads.
        Hide
        thorsten Thorsten Scherler added a comment -
        Till now I think the best hint gave Antonio.

        If you do
        cd tomcat5.5/bin
        mv commons-logging-api.jar commons-logging-api.jar.bck
        cp $SOME_WHERE/commons-logging-1.0.4.jar commons-logging-api.jar

        Then you get a slight different error:
        SEVERE: Error deploying web application directory boja2
        org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@1fe4169 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;@1fe4169 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category))
                at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
                at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
                at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370)
                at org.apache.catalina.core.ContainerBase.getLogger(ContainerBase.java:381)
                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4119)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
                at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
                at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
                at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
                at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
                at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
                at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
                at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
                at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
                at org.apache.catalina.core.StandardService.start(StandardService.java:448)
                at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
                at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
        Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@1fe4169 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)
                at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)
                at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
                ... 26 more
        Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category
                at java.lang.Class.getDeclaredConstructors0(Native Method)
                at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
                at java.lang.Class.getConstructor0(Class.java:2671)
                at java.lang.Class.getConstructor(Class.java:1629)
                at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
                ... 27 more
        Oct 1, 2007 4:38:07 PM org.apache.catalina.startup.HostConfig deployDirectory
        Show
        thorsten Thorsten Scherler added a comment - Till now I think the best hint gave Antonio. If you do cd tomcat5.5/bin mv commons-logging-api.jar commons-logging-api.jar.bck cp $SOME_WHERE/commons-logging-1.0.4.jar commons-logging-api.jar Then you get a slight different error: SEVERE: Error deploying web application directory boja2 org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@1fe4169 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;@1fe4169 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category))         at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)         at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)         at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370)         at org.apache.catalina.core.ContainerBase.getLogger(ContainerBase.java:381)         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4119)         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)         at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)         at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)         at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)         at org.apache.catalina.core.StandardService.start(StandardService.java:448)         at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)         at org.apache.catalina.startup.Catalina.start(Catalina.java:552)         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)         at java.lang.reflect.Method.invoke(Method.java:585)         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433) Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@1fe4169 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)         at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)         at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)         ... 26 more Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category         at java.lang.Class.getDeclaredConstructors0(Native Method)         at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)         at java.lang.Class.getConstructor0(Class.java:2671)         at java.lang.Class.getConstructor(Class.java:1629)         at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)         ... 27 more Oct 1, 2007 4:38:07 PM org.apache.catalina.startup.HostConfig deployDirectory
        Hide
        thorsten Thorsten Scherler added a comment -
        With apache-tomcat-6.0.14 this error is not happening.

        Seems to be special to tomcat-5.5.*.

        Since with updating to tomcat-6 is fixing the problem I changing to to wont fix here.
        Show
        thorsten Thorsten Scherler added a comment - With apache-tomcat-6.0.14 this error is not happening. Seems to be special to tomcat-5.5.*. Since with updating to tomcat-6 is fixing the problem I changing to to wont fix here.
        Hide
        thorsten Thorsten Scherler added a comment -
        Actually the problem is not solved at all. As soon you add a second webapp you get this ugly bug again.
        Show
        thorsten Thorsten Scherler added a comment - Actually the problem is not solved at all. As soon you add a second webapp you get this ugly bug again.
        Hide
        thorsten Thorsten Scherler added a comment -
        The real problem lies in the web.xml (here forrest).

        We use here:
        ...
        <!--
              Set commons-logging classes, in particular JCS, to use the logkit so the log messages
              are properly handled by cocoon.
            -->
            <init-param>
              <param-name>force-property</param-name>
              <param-value>
                org.apache.commons.logging.Log=org.apache.commons.logging.impl.LogKitLogger
              </param-value>
            </init-param>

            <!--
              This parameter allows you to startup Cocoon2 immediately after startup
              of your servlet engine.
            -->
            <load-on-startup>1</load-on-startup>
        ...

        This combination is forcing the usage of the LogKitLogger for ALL servlets in your servlet container. I tested with Jetty as well and you will get the same error.

        The explanation is that since the cocoon servlet is loaded first we are setting the org.apache.commons.logging.Log variable for the whole container.

        http://commons.apache.org/logging/troubleshooting.html#Fixes

        Meaning no other servlet can override this any more, very bad if you have different servlets/contexts.

        The solution is instead of using an init-param a context-param. This way every context can handle its on logging:
        ...
        <context-param>
          <param-name>force-property</param-name>
          <param-value> org.apache.commons.logging.Log=org.apache.commons.logging.impl.LogKitLogger
          </param-value>
        </context-param>
        ...

        Will apply a fix ASAP.
        Show
        thorsten Thorsten Scherler added a comment - The real problem lies in the web.xml (here forrest). We use here: ... <!--       Set commons-logging classes, in particular JCS, to use the logkit so the log messages       are properly handled by cocoon.     -->     <init-param>       <param-name>force-property</param-name>       <param-value>         org.apache.commons.logging.Log=org.apache.commons.logging.impl.LogKitLogger       </param-value>     </init-param>     <!--       This parameter allows you to startup Cocoon2 immediately after startup       of your servlet engine.     -->     <load-on-startup>1</load-on-startup> ... This combination is forcing the usage of the LogKitLogger for ALL servlets in your servlet container. I tested with Jetty as well and you will get the same error. The explanation is that since the cocoon servlet is loaded first we are setting the org.apache.commons.logging.Log variable for the whole container. http://commons.apache.org/logging/troubleshooting.html#Fixes Meaning no other servlet can override this any more, very bad if you have different servlets/contexts. The solution is instead of using an init-param a context-param. This way every context can handle its on logging: ... <context-param>   <param-name>force-property</param-name>   <param-value> org.apache.commons.logging.Log=org.apache.commons.logging.impl.LogKitLogger   </param-value> </context-param> ... Will apply a fix ASAP.
        Hide
        thorsten Thorsten Scherler added a comment -
        Committed revision 585929.
        Show
        thorsten Thorsten Scherler added a comment - Committed revision 585929.

          People

          • Assignee:
            Unassigned
            Reporter:
            thorsten Thorsten Scherler
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development