Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problems with running a servlet ??  RSS feed

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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..


Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!