File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JForum and the fly likes JForum Causing Tomcat Not to Start Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "JForum Causing Tomcat Not to Start" Watch "JForum Causing Tomcat Not to Start" New topic
Author

JForum Causing Tomcat Not to Start

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
This error seems to indicate that Tomcat is finding the ForumSessionListener class, but then failing to find the Servlet spec API class (javax.servlet.http.HttpSessionListener) that this class impliments.

This might be because you might have two jars that contain implementations of the HttpSessionListener class in it. Tomcat's ClassLoader security mechanism can cause class not found errors if a class lower down the chain tries to replace a higher level class.

The HttpSessionListener class should only be in Tomcat's common/lib/servlet-api.jar file and not an ANY other webapp's lib directory or the shared/lib directory.

Note that this class may be located in another jar name, e.g. Sun's J2EE implimentation, JBoss's and the like. It might also be located in another webapp. TC's order of initializing contexts can be somewhat random so the sometimes it work, sometimes it fails may be related to the order in which other web apps get loaded. And it fails if the "bad" context is loaded first...




[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
monroe, thanks for that answer! Great reply, just what we needed. Our hosting company's Tomcat person didn't know the answer to this one, so good on ya that you did.
[originally posted on jforum.net by akindo]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi. Occasionally when we restart Tomcat 5.5, we get the error message below. This happens in about 30% of cases when we restart the server. The only way we can bring the server back up is by continuously stopping and starting Tomcat. This can take between 1 - 15 minutes. Clearly this is a significant problem. Does anyone have any ideas what causes this error? Thanks a lot.

07-Nov-2007 12:42:49 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class net.jforum.ForumSessionListener
java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1274)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3712)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
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)
[originally posted on jforum.net by akindo]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JForum Causing Tomcat Not to Start