It's not a secret anymore!
The moose likes Servlets and the fly likes Running Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Running Servlet" Watch "Running Servlet" New topic

Running Servlet

Richard Mendoza
Ranch Hand

Joined: Feb 26, 2003
Posts: 48
I'm using Tomcat 4.1 as the Web Server. I did the following procedures.
1. Under the webapps directory of Tomcat, I created a folder named myApps, this is the directory where all my java programs will be placed.
2. Under myApps directory, I created a directory named WEB-INF and inside WEB-INF, I created a directory named classes.
3. I created a servlet named, I saved it inside the classes directory compiled it producing no errors, thus SampleServlet.class has been created.
4. I run an Internet Explorer and inside the address box, I typed:
but, I am producing an error message. The message tells "unavailable" well in fact I checked on my servlet and it's on the right location.
I just followed the instructions that I found in a Java book.
Can anybody help me.... Thanks a lot!

Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

I don't see this in your list, so I have to point it out - Make sure Tomcat is running! If you go into the bin directory there is a startup.bat file that you can use to start Tomcat. There is also a shutdown.bat you can use to stop Tomcat.

If Tomcat is running (and you just forgot to mention it) also go into the logs directory and make sure that your "myApps" web app context was started correctly. If there are any problems with your deployment descriptor (among other things), the web app (and any servlets in it) won't be loaded. Search through the logs and see if there are any errors preventing your web app from loading.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
Its the dreaded "invoker" servlet thing again. See this entry in the ranch FAQ.
I agree. Here's the link:
subject: Running Servlet
It's not a secret anymore!