Robert,
As Phillip said you have just met the Ghost of Invoker Past.
Short story is that it can be used for evil thus commented out.
Short fix is to uncomment it.
But as you did try the correct way you tried to add mappings, I say good for
you and don't give up yet. No to fix your problem. You have that you added:
<servlet>
<servlet-name>SampleServlet</servlet-name>
<servlet-class>samplepackage.SampleServlet</servlet-class>
</servlet>
If this is all you put in then your problem is you are missing the second
part.
Here is an example of a working web.xml.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app id="WebApp">
<display-name>death</display-name>
<servlet>
<servlet-name>Info</servlet-name>
<display-name>Info</display-name>
<servlet-class>reeper.Info</servlet-class>
</servlet>
<servlet>
<servlet-name>Select</servlet-name>
<display-name>Select</display-name>
<servlet-class>reeper.Select</servlet-class>
</servlet>
<servlet>
<servlet-name>Playing</servlet-name>
<display-name>Playing</display-name>
<servlet-class>reeper.Playing</servlet-class>
</servlet>
<servlet>
<servlet-name>Scores</servlet-name>
<display-name>Scores</display-name>
<servlet-class>reeper.Scores</servlet-class>
</servlet>
<servlet>
<servlet-name>Status</servlet-name>
<display-name>Status</display-name>
<servlet-class>reeper.Status</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Info</servlet-name>
<url-pattern>/Info</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Select</servlet-name>
<url-pattern>/Select</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Players</servlet-name>
<url-pattern>/Players</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Players</servlet-name>
<url-pattern>/Golfers</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Scores</servlet-name>
<url-pattern>/Scores</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Status</servlet-name>
<url-pattern>Status</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
Note the order is important.
Doug
----- Original Message -----
From: "Robert Mazur" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Saturday, March 27, 2004 5:16 PM
Subject: JSP works, Servlet does not work
> SUMAMRY:
> JSP's work, but servlets give:
> HTTP Status 404 - /sampleapp/servlet/samplepackage.SampleServlet
>
> DETAIL:
> I am a long time tomcat 3.X user. I'm trying to switch to version 5.0.19.
I
> am at the end of full day #2 trying to get a simple webapp to work with:
> -SUSE9, -Apache 2.0.49, -Tomcat 5.0.19
> -jakarta-tomcat-connectors-jk2-2.0.4-src
>
> Here's the kicker: Tomcat's sample-servlets *do* work, and I have a
servlet
> auto-load in my app's web.xml and that DOES work too. But direct calls to
> this don't work:
> http://localhost/sampleapp/servlet/samplepackage.SampleServlet
>
> The same exact WAR file works when placed into tomcat 3.2.23.
>
> I think I have tried everything imaginable, using online docs, O'Reilly's
book
> and Wrox books as reference, archives to this list, including:
>
> 1) Let the Tomcat Manager add the war file for me
> 2) Added a <Context> into tomcat's server.xml for the app
> 3) Added a context fragment into the webapps/ directory
> 4) Specifically add mapping to the app's web.xml:
> <servlet>
> <servlet-name>SampleServlet</servlet-name>
> <servlet-class>samplepackage.SampleServlet</servlet-class>
> </servlet>
> I have never had to specifically map each individual servlet in the app's
> web.xml file before while using version 3.x. And the all the various docs
> are not conclusive of whether this is mandatory. Is it?
>
> Anyway, all my servlets reside in the correct place in the .war and the
> resulting directory, for example:
>
<tomcat_home>/webapps/sampleapp/WEB-INF/classes/samplepackage/SampleServlet
>
> And, the log files reveal nothing. The apache log file notes that the
servlet
> was called. And the tomcat catalina.log shows nothing other than the
> auto-loaded servlet correctly launching.
>
> What's a guy gotta do to get this to work? :-) Seriously though, any
pointers
> would be MUCH appreciated.
>
> Rob
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]