6 Replies Latest reply on Apr 25, 2003 11:51 PM by jonlee

    Http error 404 servlet not found

    grice96

      Hello everybody in jboss land.

      I have a big problem:
      I start my JBoss server
      Create a folder servlet.war (in which is located in the ~/deploy/ folder)
      Create a servlet program
      Save the program in the servlet.war folder
      Compile the servlet with j2sdk1.4.1 java development software
      The servlet's class is created and saved in the Servlet.war folder (no problem compiles correctly)
      I go to my localhost URL (http://localhost:8080/servlet/(my servlet name)
      I get an http error 404 that the name of the program is not found

      Please tell me if I am missing something?

      Thanks a bunch!

        • 1. Re: Http error 404 servlet not found
          tripperm

          I have a similar problem with JBoss 3.2.0 Tomcat 4.1.24. I have servlets and jsp pages bundled in a war file that is inside an ear file with other EJBs. I put the ear file in the deploy directory and statup JBoss. What is strange is that I can get to jsp pages that are in the war file, but when I attempt to make a call to one of my servlets directly, I get the 404 error.

          This was all working fine with JBoss 3.0.2 and Tomcat 4.0.1. I imagine it is some configuration problem somewhere, but I have no clue where to start.

          Any help would be appreciated.

          • 2. Re: Http error 404 servlet not found
            tripperm

            I was able to solve my problem, and hopefully this will help anyone else coming across this thread. Between Tomcat 4.0.4 and 4.1.24 there was a change in the web.xml file. You now need to put a server mapping element in your web.xml file like so:

            <servlet-mapping>
            <servlet-name>YourServeletName</servlet-name>
            <url-pattern>/servlet/*</url-pattern>
            </servlet-mapping>

            Once I did this, everything worked fine for me.

            • 3. Re: Http error 404 servlet not found
              raja05

              Shouldnt it be

              <servlet-mapping>
              <servlet-name>invoker</servlet-name>
              <url-pattern>/servlet/*</url-pattern>
              </servlet-mapping>


              • 4. Re: Http error 404 servlet not found
                yoyodyne

                what is invoker?

                • 5. Re: Http error 404 servlet not found
                  raja05

                  From web.xml in conf directory of Tomcat distribution,


                  <!-- The "invoker" servlet, which executes anonymous servlet classes that have not been defined in a web.xml file. Traditionally, this servlet is mapped to URL pattern "/servlet/*", but you can map it to other patterns as well. -->

                  <servlet-name>invoker</servlet-name>
                  <servlet-class>
                  org.apache.catalina.servlets.InvokerServlet
                  .........


                  • 6. Re: Http error 404 servlet not found
                    jonlee

                    Note that the execution of anonymous servlets was removed from Tomcat 4.1.12 onwards as this is an identified security hole.