aspose file tools*
The moose likes Servlets and the fly likes Error allocating a servlet instance 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 » Java » Servlets
Bookmark "Error allocating a servlet instance" Watch "Error allocating a servlet instance" New topic
Author

Error allocating a servlet instance

christelle scharff
Greenhorn

Joined: Apr 08, 2007
Posts: 2
Hi,

I try to run a servlet I wrote. It works sometimes and some other times I get the error message in the broswer. I also included the logs:

- catalina.2007-04-08.log

- catalina.out

- localhost.2007-04-08.log

Why does it work sometimes and some other times it does not?

Could you tell me what I should do to solve this problem?

Thanks in advance,

Christelle

*** BROWSER

HTTP Status 500 type Exception report message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error allocating a servlet instance
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)

root cause

java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
java.net.URLClassLoader.access$100(URLClassLoader.java:56)
java.net.URLClassLoader$1.run(URLClassLoader.java:195)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1253)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1187)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.12 logs.

*** catalina.2007-04-08.log

Apr 8, 2007 1:22:41 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Portable Runtime which allows optimal performance in production environments was not found on the java.libra
ry.path: /opt/java/jdk1.5.0_08/jre/lib/i386/server:/opt/java/jdk1.5.0_08/jre/lib/i386:/opt/java/jdk1.5.0_08/jre/../lib/i386:/
opt/oracle/lib
Apr 8, 2007 1:22:41 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-26099
Apr 8, 2007 1:22:41 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 773 ms
Apr 8, 2007 1:22:41 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Apr 8, 2007 1:22:41 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.12
Apr 8, 2007 1:22:41 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Apr 8, 2007 1:22:43 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-26099
Apr 8, 2007 1:22:43 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Apr 8, 2007 1:22:43 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1376 ms

*** catalina.out

Apr 8, 2007 1:22:41 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Portable Runtime which allows optimal performance in production environments was not found on the java.libra
ry.path: /opt/java/jdk1.5.0_08/jre/lib/i386/server:/opt/java/jdk1.5.0_08/jre/lib/i386:/opt/java/jdk1.5.0_08/jre/../lib/i386:/
opt/oracle/lib
Apr 8, 2007 1:22:41 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-26099
Apr 8, 2007 1:22:41 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 773 ms
Apr 8, 2007 1:22:41 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Apr 8, 2007 1:22:41 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.12
Apr 8, 2007 1:22:41 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Apr 8, 2007 1:22:43 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-26099
Apr 8, 2007 1:22:43 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Apr 8, 2007 1:22:43 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1376 ms

*** localhost.2007-04-08.log

Apr 8, 2007 1:22:42 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Apr 8, 2007 1:22:42 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Apr 8, 2007 1:22:42 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Apr 8, 2007 1:22:42 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Apr 8, 2007 1:22:57 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet Login
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
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:1253)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1187)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1027)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:750)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
How about posting it in Apache/Tomcat forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error allocating a servlet instance