File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problems with running a servlet ??

 
vamsee krishna
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 489
Eclipse IDE Java Tomcat Server
  • 0
  • 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)

ram.

You can learn more about servlets from this sun tutorial
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • 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

thanks,
Dave.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic