Announcement Announcement Module
Collapse
No announcement yet.
SEVERE: Error listenerStart Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SEVERE: Error listenerStart

    I'm getting the following during startup of Tomcat 5.5:

    FINE: Processing context [/myelibrary] web configuration resource file:///opt/dl
    dg/apache-tomcat-5.5.23/conf/web.xml
    log4j:WARN No appenders could be found for logger (org.apache.commons.digester.D
    igester.sax).
    log4j:WARN Please initialize the log4j system properly.
    Jan 26, 2008 10:09:18 AM org.apache.catalina.startup.ContextConfig defaultWebCon
    fig
    FINE: Processed default web.xml /opt/dldg/apache-tomcat-5.5.23/conf/web.xml 241
    Jan 26, 2008 10:09:18 AM org.apache.catalina.startup.ContextConfig applicationWe
    bConfig
    FINE: Parsing application web.xml file at jndi:/localhost/myelibrary/WEB-INF/web
    .xml
    Jan 26, 2008 10:09:18 AM org.apache.catalina.startup.ContextConfig start
    FINE: Pipeline Configuration:
    Jan 26, 2008 10:09:18 AM org.apache.catalina.startup.ContextConfig start
    FINE: org.apache.catalina.core.StandardContextValve/1.0
    Jan 26, 2008 10:09:18 AM org.apache.catalina.startup.ContextConfig start
    FINE: ======================
    Jan 26, 2008 10:09:23 AM org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    Jan 26, 2008 10:09:23 AM org.apache.catalina.core.StandardContext start
    SEVERE: Context [/myelibrary] startup failed due to previous errors

    Here is the snippet of my web.xml that starts the listeners

    <listener>
    <listener-class>
    org.springframework.web.util.Log4jConfigListener
    </listener-class>
    </listener>
    <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListe ner
    </listener-class>
    </listener>

    I've seen plenty of posts about this error but no solutions. Also, the interesting thing here is that the error only occurs when starting
    Tomcat. If I then use the Tomcat manager to start the above context it starts up without error. I have not been able to get any other log messages out of this error. Here's the log messages from the successful startup from the manager:

    FINE: ContextConfig: Processing START
    Jan 26, 2008 11:04:10 AM org.apache.catalina.startup.ContextConfig processDefaul
    tWebConfig
    FINE: Processing context [/myelibrary] web configuration resource file:///opt/dl
    dg/apache-tomcat-5.5.23/conf/web.xml
    Jan 26, 2008 11:04:11 AM org.apache.catalina.startup.ContextConfig defaultWebCon
    fig
    FINE: Processed default web.xml /opt/dldg/apache-tomcat-5.5.23/conf/web.xml 209
    Jan 26, 2008 11:04:11 AM org.apache.catalina.startup.ContextConfig applicationWe
    bConfig
    FINE: Parsing application web.xml file at jndi:/localhost/myelibrary/WEB-INF/web
    .xml
    Jan 26, 2008 11:04:11 AM org.apache.catalina.startup.ContextConfig start
    FINE: Pipeline Configuration:
    Jan 26, 2008 11:04:11 AM org.apache.catalina.startup.ContextConfig start
    FINE: org.apache.catalina.core.StandardContextValve/1.0
    Jan 26, 2008 11:04:11 AM org.apache.catalina.startup.ContextConfig start
    FINE: ======================





    I do notice that the commons-digester wants to print a message but can't find a log4j configuration. . .

    Thanks for any help.
    Last edited by vdaniels; Jan 26th, 2008, 10:08 AM.

  • #2
    fist use the code tags!!
    <code> </code> replace <> by []

    second

    Code:
    <listener>
    <listener-class>
    org.springframework.web.util.Log4jConfigListener
    </listener-class>
    </listener>
    <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListe ner
    </listener-class>
    </listener>
    furthermore of that, where you sat where find the log4 properties??

    BTW: check your .jar

    Comment


    • #3
      Usually I get this error when a JAR file is missing from application classpath, so check your jars first.

      Comment


      • #4
        Thanks for the info about posting.

        As for log4j props they are set up in the context-param section with the following tag
        [code]
        <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>/WEB-INF/log4j-${PHYSICAL_LOCATION}.properties</param-value>
        </context-param>
        [code]

        The PHYSICAL_LOCATION is a system property which seems to work fine. If I am missing a jar then why does this configuration work when I do a context "start" or "reload". I only have a problem when the whole JVM is being started or restarted. That is, how can a jar be missing and not missing

        BTW, the log4j configuration works fine for the restart. What I'm suspecting is it is the log4j listener startup that's the problem, but I'm getting no info from the logs.

        Comment


        • #5
          your second code tag missing the / , it should be </code>, replace <> by []

          Code:
          The PHYSICAL_LOCATION is a system property which seems to work fine. 
          <param-value>/WEB-INF/log4j-${PHYSICAL_LOCATION}.properties</param-value>
          i think is wrong

          1: which value you use for ${PHYSICAL_LOCATION}?
          2: try how testing writting the complete path (i mean without ${PHYSICAL_LOCATION})

          I only have a problem when the whole JVM is being started or restarted.
          how you do that?

          regards

          Comment


          • #6
            The PHYSICAL_LOCATION is a system parameter, is definitely set, there's no problem finding the file name that's built. However, in the interest of science, I put the actual file name in and obtained the same result. As before, it won't start during a full tomcat restart: bin/shutdown.sh followed by bin/startup.sh
            but will start if I do a context "start" from the Tomcat management console. All other contexts start, including ones that use the above mentioned "PHYSICAL_LOCATION" parameter to build to log4j properties file name.

            I do appreciate the suggestions, thanks!

            Comment


            • #7
              As before, it won't start during a full tomcat restart: bin/shutdown.sh followed by bin/startup.sh
              now i am clear in your situation

              suggestion, use /bin/catalina.sh run instead of bin/startup.sh and Ctrl+c to shutdown
              you should see in the terminal now the report in real time of tomcat

              second,
              Code:
              The PHYSICAL_LOCATION is a system parameter
              this type of variables are problematic some time in linux with log4j,

              However, in the interest of science, I put the actual file name in and obtained the same result
              mmm

              Code:
              FINE: org.apache.catalina.core.StandardContextValve/1.0
              Jan 26, 2008 10:09:18 AM org.apache.catalina.startup.ContextConfig start
              FINE: ======================
              Jan 26, 2008 10:09:23 AM org.apache.catalina.core.StandardContext start
              SEVERE: Error listenerStart
              Jan 26, 2008 10:09:23 AM org.apache.catalina.core.StandardContext start
              SEVERE: Context [/myelibrary] startup failed due to previous errors
              now reading carefully more your error report,
              i had this problem when spring detect in the context (your case myelibrary)
              so log4jb claim or show this error

              now you should see the error when you start up your tomcat with catalina script

              to end, this error must be written in your tomcat log report

              regards

              Comment


              • #8
                Ok, I've got some additional information.
                First observation: Disabling the Log4j Listener in web.xml results in the context loading, however, I do get a stack trace right before it loads complaining about the Tld listener, but it loads and so do other contexts.

                Second observation: In my Tomcat installation I have two contexts (actually more on some platforms). In all previous attempts, the other context, called /elibrary loads first, has a very similar listener configuration, and always started up all right, then the /myelibrary context attempts to load and fails (when the log4j listener is in place). I then arranged so that the /myelibrary context loads first and /elibrary loads second. Now, the /myelibrary context starts fine (loads first) and the /elibrary context fails exactly the same way the /myelibrary context was failing.

                I'm guessing that this must mean the log4j configurations are somehow stepping on each other, but it is not at all obvious how.

                Any thoughts would be appreciated! Thanks!

                Comment


                • #9
                  Hello @ all!

                  I am able to reproduce the behaviour.

                  One Application works fine. The deployment of the same Application additionally under different Context-Name fails as described before.

                  Tomcat 6.0.14 (same error in different versions)

                  my web.xml (in both war files):
                  Code:
                  ...
                      <context-param>
                          <param-name>log4jConfigLocation</param-name>
                          <param-value>classpath:log4j.properties</param-value>
                      </context-param>
                      <listener>
                          <listener-class>
                              org.springframework.web.util.Log4jConfigListener
                          </listener-class>
                      </listener>
                  ...
                  Removing of the Listener helps , but lack of logging is the
                  side effect (as expected)

                  The usage of org.springframework.web.util.Log4jConfigServlet resloves this for me. But what amazes me is the text in the Spring-API:

                  Class Log4jConfigServlet
                  ...
                  Note that this class has been deprecated for containers implementing Servlet API 2.4 or higher, in favor of Log4jConfigListener .
                  According to Servlet 2.4, listeners must be initialized before load-on-startup servlets. Many Servlet 2.3 containers already enforce this behavior (see ContextLoaderServlet javadocs for details). If you use such a container, this servlet can be replaced with Log4jConfigListener.
                  what the h... is wrong with my container or application or configuration?

                  Any Ideas?
                  Last edited by qbe; Apr 3rd, 2008, 10:07 AM.

                  Comment


                  • #10
                    qbe,

                    Thanks! I'm not going crazy! Yes, we came up with "disable logging" of the second application solution as well. However, it is far less than ideal and as soon as someone figures out how to actually solve the problem we want to turn our logging back on.

                    Vince

                    Comment


                    • #11
                      vdaniels, ive edited my previous post while you was writing your reply...

                      Comment


                      • #12
                        Have you seen this post on Tomcat 5.x, Commons Logging and Log4J ? We don't need to configure any log4j details in the web.xml, and the jar's and property files are just packaged in the war file.

                        Comment

                        Working...
                        X