Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Tomcat and the fly likes Tomcat not seeing servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat not seeing servlet" Watch "Tomcat not seeing servlet" New topic

Tomcat not seeing servlet

Stef Mischook

Joined: Nov 12, 2004
Posts: 15

Using Tomcat 5.0.28 standalone on windows XP with JVM 1.4, I get this error even though I have mapped my servlet in the web.xml file of the web app:

HTTP Status 404 - /


type Status report

message /

description The requested resource (/ is not available.


Apache Tomcat/5.0.28

I've placed my webapp folder in the webapps directory and all the jsp pages run fine as do my POJO's for business logic, any ideas why the servlet code could be causing problems?

The servlet mappings:

It's my first time using Tomcat, been a Resin user for years ...



<a href="" target="_blank" rel="nofollow"></a><br /><a href="" target="_blank" rel="nofollow"></a><br /><a href="" target="_blank" rel="nofollow"></a>
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13035
If the URL you are using contains "/servlet/" it may be an "invoker" servlet problem. See this FAQ here at the ranch.
Stef Mischook

Joined: Nov 12, 2004
Posts: 15

Nah, I'm actually posting to the url-pattern I defined in the web-apps web.xml file:

Could the mapping problem have to do with setting the context path for the application?

In ${catalina.home}/conf/Catalina/localhost I've created an .xml file named after my web app that contains this code:

Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

contextPath must be present, otherwise Tomcat will assume you are accessing the default application for that host (the one with no context path).

your path should be action="/myWebApp/"
Stef Mischook

Joined: Nov 12, 2004
Posts: 15

I reinstalled tomcat and things are working now.

Thanks ...
[ November 22, 2004: Message edited by: Stef Mischook ]
I agree. Here's the link:
subject: Tomcat not seeing servlet
It's not a secret anymore!