File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes problem with servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "problem with servlets" Watch "problem with servlets" New topic

problem with servlets

Raj Dutta

Joined: Aug 23, 2003
Posts: 2
I have recently started working with servlets.My test servlet is not working.I'm using JDK1.4.2 & Tomcat4.1.27
I created a 'myApp' directory under M:\Apache Group\Tomcat 4.1\webapps.
And stored my 'testingServlet.class' file under
M:\Apache Group\Tomcat 4.1\webapps\myApp\WEB-INF\classes
And 'web.xml' is under M:\Apache Group\Tomcat 4.1\webapps\myApp\WEB-INF
Typing the following url
gives http 404 error as below:

But the sample examples(bundled with Tomcat) are working fine.
Can somebody please tell me why is this problem occuring ?
Thank you
Faisal Khan
Ranch Hand

Joined: Jun 29, 2003
Posts: 285
After creating the new directory under webapp, did you restart Tomcat? Futhermore, after compiliing the new servlet, you will need to restart Tomcat (depends on setting).

The secret to creativity is knowing how to hide your sources.
Raj Dutta

Joined: Aug 23, 2003
Posts: 2
Yes I did restart Tomcat in all cases.
Do I have to change the conf\Server.xml ?
[ August 23, 2003: Message edited by: Raj Dutta ]
Scott Duncan
Ranch Hand

Joined: Nov 01, 2002
Posts: 364
In the deployment descriptor (web.xml) what is the url-pattern of your servlet? Do you have it mapped appropriately? You should see:
[ August 23, 2003: Message edited by: William Duncan ]

No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?
I agree. Here's the link:
subject: problem with servlets
It's not a secret anymore!