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 Running Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Running Servlet" Watch "Running Servlet" New topic
Author

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 SampleServlet.java, 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:
http://localhost:8080/myApps/servlet/SampleServlet
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!

Richard
Nathan Pruett
Bartender

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.


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

Joined: Mar 22, 2000
Posts: 12835
    
    5
Its the dreaded "invoker" servlet thing again. See this entry in the ranch FAQ.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running Servlet