File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes tomcat won't run my servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "tomcat won Watch "tomcat won New topic
Author

tomcat won't run my servlet

Michael Schneider
Greenhorn

Joined: Jun 21, 2002
Posts: 1
I'm setting up tomcat for the first time, and I've gotten sample HTML and JSP files to load by placing them in the tomcat_home\webapps\ROOT directory and going to http://localhost/Hello.html and Hello.jsp.
However, when I create a classes subdirectory off of tomcat_home\webapps\ROOT\WEB-INF\ and place a servlet class file there, going to http://localhost/serlvet/HelloServlet doesn't work.
The servlet compiles fine, so my CLASSPATH is working, but nothing happens when I try to load that page.
Any ideas as to what might cause this?
Thanks,
Michael
CaryB
Greenhorn

Joined: Mar 27, 2002
Posts: 8
Sounds like things have been done right so far. If it's small, perhaps you could post your code? Maybe do a simple Hello World servlet to see if that works.
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Hi
Did you set up your Servlet in web.xml?
/Rene


Regards, Rene Larsen
Dropbox Invite
kablan jean
Greenhorn

Joined: Jun 17, 2002
Posts: 3
check yo see if you hava a servel jar file in your jdk. I remember having the same problem. Find a sevlet.jar file wherever you can find it and put it in jdk... mine is C:\jdk1.3.1\jre\lib\ext\servlet.jar. Don't also forget to update your classpath.
good luck!
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Kablan, it would not even compile if servlet.jar was not in the right place.
Try specifying the port number as in... http://localhost:8080/serlvet/HelloServlet


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: tomcat won't run my servlet