Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Tomcat can't find the servlets!

807598Mar 22 2006 — edited Nov 19 2006
Hi!
I've just installed tomcat tomcat-5.5.16 with apache. Tomcat runs ok. It shows some samples (delivered with tomcat) under www.mywebsite.com/servlets-example and also www.mywebsite.com/jsp-examples. JSP files work perfectly, but when I try the servlets it can't find them:
www.mywebsite.com/servlets-examples/servlet/RequestHeaderExample
Object not found!
my classpath lokks like this:
/opt/SUNWappserver/jdk/lib:/opt/apache-tomcat/common/lib/servlet-api.jar:/opt/apache-tomcat/bin:/opt/apache-tomcat/webapps/servlets-examples/WEB-INF/classes:/opt/apache-tomcat/webapps/ROOT/WEB-INF/classes
and web.xml looks like this:
    <servlet>
        <servlet-name>invoker</servlet-name>
        <servlet-class>
          org.apache.catalina.servlets.InvokerServlet
        </servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>
and
    <!-- The mapping for the default servlet -->
    <servlet-mapping>
        <servlet-name>default</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <!-- The mapping for the invoker servlet -->

    <servlet-mapping>
        <servlet-name>invoker</servlet-name>
        <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
I changed the web.xml und conf and under WEB-INF.
I also changed server.xml to make tomcat work with apache on port 80.

What did I do wrong? What did I forget?
What is the difference between web.xml under conf and the ones under WEB-INF?

Thanks for any help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 17 2006
Added on Mar 22 2006
7 comments
518 views