You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Annam, Sunil" <SA...@intecom.com> on 2002/08/27 22:22:56 UTC
Cannot allocate servlet instance for path
Hi,
I was using Tomcat 3.x and now switched to tomcat 4.1.9. I am not able to run the servlets that I used to do. So just for testing I did the following
created a folder "exmp" under webapps. created a foler "Web-inf" under "exmp" and "classes" under "Web-inf". Copied "HelloWorldExample.class" from webapps/examples/Web-inf/classes.
webapps-->exmp
|->Web-inf
|->web.xml
|->classes
|->HelloWorldExample.class
Modified server.xml. Added the following
<Context path="/exmp" docBase="exmp" debug="0"
reloadable="true" crossContext="true">
</Context>
Created web.xml in Web-inf
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>
HelloWorldExample
</servlet-class>
</servlet>
</web-app>
When I start Tomcat and try to access HelloWorldExample by url "http://localhost:8080/exmp/servlets/HelloWorldExample", it gives me Error 404
In the localhost_log.txt
invoker: Cannot allocate servlet instance for path /exmp/servlet/HelloWorldExample
javax.servlet.ServletException: Wrapper cannot find servlet class HelloWorldExample or a class it depends on
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:880)
Any idea what is happening ? what am I missing ?
HelloWorldExample from examples/servlet/HelloWorldExample is working.
Thanks in advance.
Sunil Annam