Article:
  Java Web Applications
Subject:   HTTP Status 404 - /
Date:   2006-08-19 16:32:55
From:   brahmadapa
Hi, I have installed jakarta-tomcat-5.0.30 first time and got the following status 404 error when I start the sever and tyring to browse localhost at: http://localhost:8080/ to view the tomcat home page.


Configuration instructions got it from the below webpage: http://www.moreservlets.com/Using-Tomcat-4.html#Enable-Root-Context


Error description:
HTTP Status 404 - /
-------------------------
type Status report
message /
description: The requested resource (/) is not available.
--------------------------


I have installed tomcat in my C drive as: C:\Tomcat 5.0 and my jdk available in: C:\j2sdk1.4.2_12 and I have set the user and environment varialbles as below:

JAVA_HOME: C:\j2sdk1.4.2_12
CATALINA_HOME: C:\Tomcat 5.0
CLASSPATH: ;.;C:\j2sdk1.4.2_12\lib\tools.jar;C:\Tomcat 5.0\common\lib\servlet-api;C:\Tomcat 5.0\common\lib\jsp-api
PATH: ;C:\j2sdk1.4.2_12\bin


Please suggest me.

Full Threads Newest First

Showing messages 1 through 18 of 18.

  • HTTP Status 404 - /
    2006-08-25 12:01:14  dmersino [View]

    I just had this same problem. The message I got was identical and the command prompt which had the logs showed no exceptions at all. What's strange is that it was working just fine an hour prior. I tried rebooting, recompiling, etc., etc.

    Finally I remembered that I had changed the name of a Filter that I was using, that was referenced in the web.xml file. Once I corrected this in my web.xml, everything returned to normal.

    Normally when a class defn is incorrect you'll get a classNotFound or other exception in the logs. I don't know if this is just a bug in Apache when loading filters or if it will happen with other classes.

    So, you may want to try scanning your web.xml for any mis-spelled or missing classes that the server is trying to load.
    • HTTP Status 404 - /
      2006-08-26 00:08:15  aadityasharma [View]

      type Status report

      message //

      description The requested resource (//) is not available.
      • HTTP Status 404 - /
        2007-02-13 07:37:14  ritanegi [View]

        hello
        this is the servlet i wanted to run

        -------------------------------------------------
        import java.io.IOException;
        import java.io.PrintWriter;

        import javax.servlet.ServletException;
        import javax.servlet.http.HttpServlet;
        import javax.servlet.http.HttpServletRequest;
        import javax.servlet.http.HttpServletResponse;

        /*
        * Created on Jan 18, 2007
        *
        * TODO To change the template for this generated file go to
        * Window - Preferences - Java - Code Style - Code Templates
        */

        /**
        * @author Administrator
        *
        * TODO To change the template for this generated type comment go to
        * Window - Preferences - Java - Code Style - Code Templates
        */
        public class HelloServlet extends HttpServlet {
        public void doGet (HttpServletRequest req,
        HttpServletResponse res)
        throws ServletException, IOException
        {
        PrintWriter out = res.getWriter();


        out.println("Hello, world!");
        out.close();
        }
        }
        -------------------------------------------------
        this the web.xml file i created
        -------------------------------------------------

        <?xml version="1.0" encoding="ISO-8859-1"?>
        <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
        version="2.4">

        <servlet>
        <servlet-name>hello</servlet-name>
        <servlet-class>project.HelloServlet</servlet-class>
        </servlet>
        <servlet-mapping>
        <servlet-name>hello</servlet-name>
        <url-pattern>/servlet/project/HelloServlet</url-pattern>
        </servlet-mapping>
        </web-app>
        -------------------------------------------------
        this is the copy of manager saved by the name MyApp which is my project name too
        -------------------------------------------------
        <!--
        Context configuration file for the Tomcat Manager Web App

        $Id: manager.xml,v 1.2 2004/02/20 17:09:29 remm Exp $


        -->
        - <Context path="/Project" docBase="HelloServlet" debug="0" privileged="true">
        - <!-- Link to the user database we will get roles from
        -->
        <ResourceLink name="users" global="UserDatabase" type="org.apache.catalina.UserDatabase" />
        </Context>
        -------------------------------------------------
        my query is dat do i need to create n html file to display my output.......i haven't done it till now....i just went to my browser which is IE....n i have tomcat 5.0 installed in my system entered the url given below

        http://127.0.0.1:8080/example/servlet/HelloServlet

        but received n error report-http status 404 in the following form

        type Status report

        message /example/servlet/HelloServlet

        description The requested resource (/example/servlet/HelloServlet) is not available.

        kindly check my servlet file coding as well as the web.xml file coding whether i have correctly coded them....the error may be thr due to wrong assignment.....i m just the beginner in web services

        i'll be grateful to u
        rita negi
  • HTTP Status 404 - /
    2007-01-24 02:56:17  vijay-kumar-mishra [View]

    do one thing uninstall all the jdk n tomcat n reinstall all the software but dont delete the path's install in same place where that software was
    • HTTP Status 404 error in The requested resource (/Example) is not available.
      2007-01-25 03:45:14  aspai [View]

      hello sir,
      error is like this:
      HTTP Status 404 - /Example

      --------------------------------------------------------------------------------

      type Status report

      message /Example

      description The requested resource (/Example) is not available.


      wat to do...last 3 days i am trying,pls suggest me.its very urgent..
      • HTTP Status 404 error in The requested resource (/Example) is not available.
        2007-01-28 21:48:29  aspai [View]

        still it is givin me a same error..wat should i do..

        i tried to do in all possible ways..anybody pls suggest me...

        i am in trouble from last one week....
        • HTTP Status 404 error in The requested resource (/Example) is not available.
          2007-05-06 22:04:24  ghada80 [View]

          my servlet file path is

          C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\examples\WEB-INF\classes\HelloWorldExample.java

          and it is a famous servlet exists in Tomcat 6.0 installasion I did not build it or change it

          I try the URL

          http://localhost:8080/examples/HelloWorldExample

          And

          http://localhost:8080/HelloWorldExample

          And

          http://localhost:8080/webapps/examples/WEB-INF/classes/HelloWorldExample

          And

          http://localhost:8080/examples/WEB-INF/classes/HelloWorldExample
          And
          http://localhost:8080/WEB-INF/classes/HelloWorldExample

          And
          http://localhost:8080/classes/HelloWorldExample


          And The following message appears in the browser
          HTTP Status 404 - /examples/HelloWorldExample

          --------------------------------------------------------------------------------

          type Status report
          message /examples/HelloWorldExample
          description The requested resource (/examples/HelloWorldExample) is not available.

          --------------------------------------------------------------------------------

          Apache Tomcat/6.0.10

          I try again by changing web.xml
          by writting the URL in <servlet-name> tag, for Example
          - <servlet-mapping>
          <servlet-name>HelloWorldExample</servlet-name>
          <url-pattern>HelloWorldExample</url-pattern>
          </servlet-mapping>

          to

          <servlet-mapping>
          <servlet-name>HelloWorldExample</servlet-name>
          <url-pattern>http://localhost:8080/HelloWorldExample</url-pattern>
          </servlet-mapping>

          the same message appears,

          please help me I am in urgent need to the reply

          and if I try my own servlets what is the changes in web.xml
          • HTTP Status 404 error in The requested resource (/Example) is not available.
            2009-08-10 00:10:30  ramesh47 [View]

            use this,
            <servlet-mapping>
            <servlet-name>HelloWorldExample</servlet-name>
            <url-pattern>/HelloWorldExample</url-pattern>
            </servlet-mapping>

            this will work....
      • HTTP Status 404 error in The requested resource (/Example) is not available.
        2007-01-28 21:48:38  aspai [View]

        still it is givin me a same error..wat should i do..

        i tried to do in all possible ways..anybody pls suggest me...

        i am in trouble from last one week....
        • HTTP Status 404 error in The requested resource (/Example) is not available.
          2007-05-06 22:12:49  ghada80 [View]

          my servlet file path is

          C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\examples\WEB-INF\classes\HelloWorldExample.java

          and it is a famous servlet exists in Tomcat 6.0 installasion I did not build it or change it

          I try the URL

          http://localhost:8080/examples/HelloWorldExample

          And

          http://localhost:8080/HelloWorldExample

          And

          http://localhost:8080/webapps/examples/WEB-INF/classes/HelloWorldExample

          And

          http://localhost:8080/examples/WEB-INF/classes/HelloWorldExample
          And
          http://localhost:8080/WEB-INF/classes/HelloWorldExample

          And
          http://localhost:8080/classes/HelloWorldExample


          And The following message appears in the browser
          HTTP Status 404 - /examples/HelloWorldExample

          --------------------------------------------------------------------------------

          type Status report
          message /examples/HelloWorldExample
          description The requested resource (/examples/HelloWorldExample) is not available.

          --------------------------------------------------------------------------------

          Apache Tomcat/6.0.10
          I try again by changing web.xml
          by writting the URL in <servlet-name> tag, for Example
          - <servlet-mapping>
          <servlet-name>HelloWorldExample</servlet-name>
          <url-pattern>HelloWorldExample</url-pattern>
          </servlet-mapping>

          to

          <servlet-mapping>
          <servlet-name>HelloWorldExample</servlet-name>
          <url-pattern>http://localhost:8080/HelloWorldExample</url-pattern>
          </servlet-mapping>

          the same message appears,

          please help me I am in urgent need to the reply

          and if I try my own servlets what is the changes in web.xml
          • HTTP Status 404 error in The requested resource (/Example) is not available.
            2007-07-16 02:37:44  hellojava2 [View]

            you can change this

            <servlet-mapping>
            <servlet-name>HelloWorldExample</servlet-name>
            <url-pattern>HelloWorldExample</url-pattern>
            </servlet-mapping>

            to

            <servlet-mapping>
            <servlet-name>HelloWorldExample</servlet-name>
            <url-pattern>/HelloWorldExample</url-pattern>
            </servlet-mapping>

            Then it is working fine
            • HTTP Status 404 error in The requested resource (/Example) is not available.
              2009-01-20 21:09:23  Foccii [View]

              HTTP Status 404 error in The requested resource (/Emp1/EmpJsp.jsp) is not available.

              using struts

              change in struts-config file

              <form-beans>

              <form-bean name="EmpForm" type="com.hr.trainee.EmpForm" />
              </form-beans>


              <action-mappings>


              <action path="/EmpJsp" type="com.hr.trainee.EmpAction"
              name="EmpForm"
              scope="session"
              input="/EmpJsp.jsp" >

              <forward name="success" path="/DisplayJsp.jsp" />
              <forward name="failure" path="/EmpJsp.jsp" />
              </action>

              </action-mappings>
  • HTTP Status 404 - /
    2007-01-25 03:47:57  aspai [View]

    Hi, I have installed jakarta-tomcat-5.0.30 first time and got the following status 404 error when I start the sever and tyring to browse localhost at: http://localhost:8080/ to view the tomcat home page.


    Configuration instructions got it from the below webpage: http://www.moreservlets.com/Using-Tomcat-4.html#Enable-Root-Context



    Error description:
    HTTP Status 404 - /
    -------------------------
    type Status report
    message /
    description: The requested resource (/) is not available.
    --------------------------

    I have installed tomcat in my C drive as: C:\Tomcat 5.0 and my jdk available in: C:\j2sdk1.4.2_12 and I have set the user and environment varialbles as below:

    JAVA_HOME: C:\j2sdk1.4.2_12
    CATALINA_HOME: C:\Tomcat 5.0
    CLASSPATH: ;.;C:\j2sdk1.4.2_12\lib\tools.jar;C:\Tomcat 5.0\common\lib\servlet-api;C:\Tomcat 5.0\common\lib\jsp-api
    PATH: ;C:\j2sdk1.4.2_12\bin

    pls suggest me
    • HTTP Status 404 - /
      2007-03-23 00:06:08  kandiyoorpreethi [View]

      • HTTP Status 404 - /
        2007-07-20 12:36:31  mukkamalas [View]

        I have installed tomcat in my C drive as: C:\Tomcat 5.0 and my jdk available in: C:\j2sdk1.4.2_12 and I have set the user and environment varialbles as below:

        JAVA_HOME: C:\j2sdk1.4.2_12
        CATALINA_HOME: C:\Tomcat 5.0
        CLASSPATH: ;.;C:\j2sdk1.4.2_12\lib\tools.jar;C:\Tomcat 5.0\common\lib\servlet-api;C:\Tomcat 5.0\common\lib\jsp-api
        PATH: ;C:\j2sdk1.4.2_12\bin

      • HTTP Status 404 - /
        2007-07-23 12:47:54  RaviKA [View]

        Did you start the tomcat. If yes did it start without any problems. Please check the log to check for errors. Sometimes java-bind error may error due to port problems.
    • HTTP Status 404 - /
      2007-03-23 00:06:08  kandiyoorpreethi [View]

      • HTTP Status 404 - /
        2009-12-06 05:37:57  pinkett [View]

        hello im trying to implement my first servlet program hello world and...when im trying to run..it says
        type Status report
        message description The requested resource is not available
        these are the current path set up
        path C:\Program Files\Java\jdk1.5.0_03
        class path C:\Program Files\Java\jdk1.5.0_03
        CATALINA_HOME C:\Program Files\Apache Software Foundation\Tomcat 6.0
        JAVA_HOME C:\Program Files\Java\jdk1.5.0_03

        please help me with this
        thanks