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

problems with running a servlet ??

vamsee krishna

Joined: Dec 06, 2004
Posts: 3

I have java J2SDK 1.4.2 and J2RE1.5.1 installed on my sytem. I also have TomCat Server running on my system. i have downloaded a servlet example from the net and compiled it. it got compiled but is not running .i have placed the .class file as well as the .java file in the below mentioned path...

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\servlets-examples\WEB-INF\classes;

and i tried to run it from Internet Explorer 6.0 by typing in the address bar the following :

which is giving me error whereas a "HelloWorldExample placed in the same directory is working well.

the error it is generating is as given below:

HTTP Status 404 - /servlets-examples/servlet/SomeServlet


type Status report

message /servlets-examples/servlet/SomeServlet

description The requested resource (/servlets-examples/servlet/SomeServlet) is not available.


Apache Tomcat/5.5.4

please help me in this regard..

i want my servlet to be up and running.

also ant net source for learning servlets and JSP technology for a starter would be highly useful..


ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

What package is your servlet in ?
Is examples.servlet.SomeServlet.class the fully qualified name of your Servlet or does it belong to some other pkg ?

You shouldnt be accessing servlets using their class names. You have to register them in your web.xml, define a name for your servlet and access it using that name.

A sample web.xml entry is shown below.

You would now be accessing LoginServlet using
http://<machine> ort/context/login

where context is the web-context (usually the war-file name or the name of the root directory of your exploded directory of your web-application deployed on the server)


You can learn more about servlets from this sun tutorial
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

"ricky martin",
Welcome the Ranch!

We're a frindly bunch here at the Java ranch, but we take the display name rule quite seriously. You can read about it here.

Basically we require display names to be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and select a valid display name. Accounts with invalid display names get deleted, often without warning

I agree. Here's the link:
subject: problems with running a servlet ??
It's not a secret anymore!