File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Meaning of error message in Catalina.out? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Meaning of error message in Catalina.out?" Watch "Meaning of error message in Catalina.out?" New topic
Author

Meaning of error message in Catalina.out?

Jaime Lannister
Greenhorn

Joined: Mar 30, 2005
Posts: 18
When I start Tomcat, I get the following two error statements within cataline.out:

StandardContext[]: Error configuring application listener of class listeners.ContextListener: java.lang.ClassNotFoundException: listeners.ContextListener java.lang.ClassNotFoundException: listeners.ContextListener

Then it goes through a list of statements like:
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1406)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1254)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3155)
.
.
. etc.etc. through 18 statements like that (I presume its looking for the missing thing it can't find)

Then it prints the other error statement:
StandardContext[]: Error configuring application listener of class listeners.SessionListener: java.lang.ClassNotFoundException: listeners.SessionListener
java.lang.ClassNotFoundException: listeners.SessionListener

and another bunch of statements like:
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1406)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1254)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3155)
.
.
.
etc. etc.

Then finally it says that it skipped installing application listeners and that the context startup failed due to those errors.

Anyone know what those "application listeners" in the error statements are and possible reasons why why Tomcat might not be able to configure them? I can print out the whole Cataline.out file if anyone wants to see it.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Do you have a context listener entry in your web.xml?
If so, is it pointing to a valid class?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Jaime Lannister
Greenhorn

Joined: Mar 30, 2005
Posts: 18
Thanks for your suggestion. I have two web.xml files. One is in the Tomcat home directory in Tomcat4/conf/. This file was installed by the web host with Tomcat and has not been changed since to my knowlege. It does not have a listener entry.

The other one is in my site directory under /var/www/html/WEB-INF/. It is an example web.xml file that I copied into that directory and to which I added <servlet> references to the servlets I want to test. It does have listener entry:
<!-- Define example application events listeners -->
<listener>
<listener-class>listeners.ContextListener</listener-class>
</listener>
<listener>
<listener-class>listeners.SessionListener</listener-class>
</listener>

I'm looking into this further. I take it there should be a listener defined in the Tomcat directory web.xml too?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39535
    
  27

I take it there should be a listener defined in the Tomcat directory web.xml too?


No. What Ben's asking is whether the class exists, its file is valid and is in your classes directory.


Ping & DNS - updated with new look and Ping home screen widget
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

This line
<listener-class>listeners.SessionListener</listener-class>
is telling Tomcat that you want to register a session listener and that the class for this listener is "listeners.SessionListener".

If no such class exists within your app, an exception will be thrown.
I would either remove or comment out the entire "listener" section from your web.xml file unless and until you have written a listener.

Also, I don't recomend altering the global web.xml file (the one in tomcat/conf) until you A) really know what you're doing and B) have a very valid reason for doing so. That deployment descriptor contains global settings for ALL the apps running under that instance of Tomcat.

If you do play with it, make a back up copy first.
[ August 15, 2005: Message edited by: Ben Souther ]
Jaime Lannister
Greenhorn

Joined: Mar 30, 2005
Posts: 18
Thanks Ben and Ulf, your suggestions and explanations worked.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Meaning of error message in Catalina.out?
 
Similar Threads
Got java.lang.ClassFormatError: while trying to acces my App
Problem starting up servlet-examples & jsp-examples
Resource not available error in tomcat
There is no Action mapped for namespace / and action name . - [unknown location]
Adding new application in tomcat