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.
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?
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 ]
Joined: Mar 30, 2005
Thanks Ben and Ulf, your suggestions and explanations worked.