Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error configuring application listener of class listeners.

 
Abhishek Mahanty
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
After having installed jakarta-tomcat-5.0.28, I am trying to run the file startup.bat to run the server. Now the server runs, but it is unable to deploy the "servlet-examples" and "jsp-examples" web applications that come along with Tomcat.

Following is how the log file looks:
=========================================================

2004-11-16 23:07:08 StandardContext[/servlets-examples]Error configuring application listener of class listeners.ContextListener
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:709)
at java.lang.ClassLoader.loadClass(ClassLoader.java:284)
at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1255)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3775)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:480)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
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:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
===============================================================

It seems to me that the container is unable to find the Servlet API classes and interfaces, but I already have the "servlet-api.jar" file under \jakarta-tomcat-5.0.28\common\lib folder.

So may be its not a CLASSPATH problem ... or is it ?

has it anything to do with web.xml file that comes with the example applications ?

Can anyone plz help me out here ?


Thanks in advance,
Abhi.
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Abhishek,

I assume you've set the following environment variables correctly.
SET CATALINA_HOME=c:\tomcat-5.0.28
SET JAVA_HOME=c:\jdk1.XX

After you start up the tomcat (startup.bat), could you able to see the tomcat main page when accessing http://localhost:8080 ?

Could you check if your CLASSPATH pointing to any old servlet.jar file? Also, go to C:\jdk1.XX\jre\lib\ext and remove the servlet.jar to other temporary location.

Which OS are you running?

Joyce
[ November 18, 2004: Message edited by: Joyce Lee ]
 
Abhishek Mahanty
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joyce Lee:

Could you check if your CLASSPATH pointing to any old servlet.jar file? Also, go to C:\jdk1.XX\jre\lib\ext and remove the servlet.jar to other temporary location.

[ November 18, 2004: Message edited by: Joyce Lee ]


Hi Joyce,
Thanks for your prompt reply. I had some "examples" installed under the folder \jre\lib\ext\classes that were causing the problem. Thanks for pointing me in the right direction. I deleted the "examples" folder and now my applications get deployed properly.

Thanks again,
Abhi.
 
Abhishek Mahanty
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the following in JSP 2.0 specs which sheds some light on the class loading mechanism. Just wanted to share with all.

JSP.7.3.7 Translation-Time Class Loader
----------------------------------------------
The set of classes available at translation time is the same as that available at runtime:
* the classes in the underlying Java platform,
* those in the JSP container, and
* those in the class files in WEB-INF/classes,
* in the JAR files in WEB-INF/lib, and, indirectly those indicated through the use of the class-path attribute in the METAINF/MANIFEST file of these JAR files.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic