This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "tomcat won Watch "tomcat won New topic

tomcat won't run my servlet

Michael Schneider

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?

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

Did you set up your Servlet in web.xml?

Regards, Rene Larsen
Dropbox Invite
kablan jean

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

So much trouble in the world -- Bob Marley
subject: tomcat won't run my servlet
Similar Threads
where to put servlets? (searched 1st)
unable to compile
help please
how to expose defined directory under webapps
trouble loading servlet class on Tomcat4.1