This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Need help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Need help" Watch "Need help" New topic

Need help

Johnson K Jose
Ranch Hand

Joined: Jul 07, 2002
Posts: 36
Hi all
I am getting the following error while running the servlet in the url
I am using Tomcat 4.1.24
HTTP Status 404 - /servlet/HelloServlet
type Status report message /servlet/HelloServlet
description The requested resource (/servlet/HelloServlet) is not available.
Apache Tomcat/4.1.24
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloServlet extends HttpServlet
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws ServletException, IOException
PrintWriter out = response.getWriter();
String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
out.println(docType +
"<HTML>\n" +
"<HEAD><TITLE>Hello</TITLE></HEAD>\n" +
"<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1>Hello</H1>\n" +
I have put the HelloServlet.class file inside Tomcat 4
F:\Program Files\Apache Group\Tomcat 4.1\webapps\ROOT\WEB-INF\classes directory
Please guide me where am I going wrong.
Thanks in advance
John Hembree
hired gun
Ranch Hand

Joined: Mar 07, 2003
Posts: 250

I had the same problem and was able to resolve it by uncommenting the following section in the web.xml file in the conf directory of your Tomcat installation. I am using the same version: 4.1.24

This is talked about at this website Configure Tomcat. Look at step 3 "Enable the Invoker Servlet".
Johnson K Jose
Ranch Hand

Joined: Jul 07, 2002
Posts: 36
Hi John
thanks for the mail.
I have uncommanded the same, still it is not working. now i just copied the file HelloServlet.class in to the followng dir.
F:\Program Files\Apache Group\Tomcat 4.1\webapps\examples\WEB-INF\classes
and tried the url
http://localhost:8080/examples/servlet/HelloServlet it is working? still I don't know what is happening. can any one please give me some light
Thanks in advance
I agree. Here's the link:
subject: Need help
It's not a secret anymore!