Dear Sirs, dear group,

Where does Tomcat expect me to put my class file, or jar file?
Is it sufficient to put the servlet class in WEB-INF classes or must you 
install a war file?

I am using Tomcat 4.1 to get a simple servlet working. I have succeeded in 
compiling the servlet. I have put the class in the directory

C:\Program Files\Apache Group\Tomcat 4.1\webapps\examples\WEB-INF\classes

And I was able to call my servlet from

http://localhost:8090/examples/servlet/HelloIZ

Now I want to call my servlet using

http://localhost:8090/HelloIZExample

After advice from the mailing list I have added information to the web.xml in  
..\Tomcat 4.1\conf 

    <servlet>
        <servlet-name>HelloIZ</servlet-name>
        <servlet-class>HelloIZ</servlet-class>
    </servlet>


   <servlet-mapping>
        <servlet-name>HelloIZ</servlet-name>
        <url-pattern>/HelloIZExample</url-pattern>
    </servlet-mapping>


The XML is correctly read, Tomcat starts up OK. But then using the browser 
gives me an error:

I put this in the browsers address bar

http://localhost:8090/HelloIZExample

And then I get an exception indicating Tomcat cannot find the Java class for my 
servlet

javax.servlet.ServletException: Wrapper cannot find servlet class HelloIZ or a 
class it depends on
        at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:844)
        at 
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:621)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:163)


Hence it probably expect me to do something else then putting the class in

...\webapps\examples\WEB-INF\classes

Stupid question may-be but, where should it go?

Reply via email to