aspose file tools*
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
Author

problems with running a servlet ??

vamsee krishna
Greenhorn

Joined: Dec 06, 2004
Posts: 3
Hai,

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 :

http://172.16.8.50/servlets-examples/servlet/SomeServlet


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

thanks

byee
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)

ram.

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

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

thanks,
Dave.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problems with running a servlet ??