File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes tomcat servlet not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "tomcat servlet not found" Watch "tomcat servlet not found" New topic

tomcat servlet not found

Jo Lee
Ranch Hand

Joined: Jun 26, 2001
Posts: 35
my form action is "myPackage.thisPackage.thatPackage.servlet"
when I run the jsp page in tomcat 4.0.4, I get a error message says:"The requested resource(/MySite/myPackage.thisPackage.thatPackage.servlet) is not available.
My file structures are:
What is wrong?
Jo Lee
Ranch Hand

Joined: Jun 26, 2001
Posts: 35
I find out that the uri for the servlet is:
so I change the form action="/servlet/myPackage.thisPackage.thatPackage.Servlet"
I tried also the following:
form action="servlet/myPackage.thisPackage.thatPackage.Servlet"
both give me the same problem: the requested resource is not available.
Please help
Praveen K Pippiri

Joined: Jun 17, 2002
Posts: 23
Make the Form action as
You have to include the web application name also as far as I know.

Praveen<br />Sun Certified Programmer for Java 2 Platform.
Avais Aziz

Joined: Oct 07, 2001
Posts: 16
Hi Jo!
Change your form action as below.
Jo Lee
Ranch Hand

Joined: Jun 26, 2001
Posts: 35
Sorry, instead of writing a response, I wrote a new topic by mistake.
I have tried all the suggestions, and it still says that servlet not found.
Is there any trick about tomcat install? May be my tomcat server is not configured right? I am using tomcat-4.0.4
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

No, Tomcat doesn't do any tricky stuff finding servlets - it's strictly per spec. Tomcat has its own forum here on the JavaRanch, BTW, but you'd be having the same problem with WebSphere or WebLogic.
Nowhere did you mention what you set up in the web.xml file, so I'll wager you didn't set it up.
web.xml is where you map the URL to a servlet ID and the servlet ID to its associated class. Older servlet programmers are used to not having to do this explicitly, but that was a major security hole and most modern-day appservers won't find a servlet unless web.xml tells them about it.

An IDE is no substitute for an Intelligent Developer.
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
Double-check your installation with this
Jo Lee
Ranch Hand

Joined: Jun 26, 2001
Posts: 35
Thanks for the information. I did not do the modification on server.xml . Now I have done it and tried the sample servlet from the instruction, it worked beautifully.
Thanks again.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Moved from Servlets -> Apache/Tomcat
I agree. Here's the link:
subject: tomcat servlet not found
It's not a secret anymore!