Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

problems with running a servlet ??

Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

Then YOU must do the pig's work! Read this tiny ad. READ IT!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic