[Logo]
Forums Register Login
HTTP Status 404 - Servlet Not Found
Good day all,

I am writing my first web app and am experiencing an issue with a servlet (I only have one ). When accessing my servlet via URL, I receive the below error:

HTTP Status 404 - /TiffanyPadilla/servlet/HelloWho
type Status report
message /TiffanyPadilla/servlet/HelloWho
description The requested resource (/TiffanyPadilla/servlet/HelloWho) is not available.
JBoss Web/2.1.6.GA


I have completed the following in order to make (or try to make) it work:

Edit the web.xml file for the web app (located at TiffanyPadilla.war/WEB-INF/lib/web.xml):

Created a context.xml (located at TiffanyPadilla.war/META-INF/context.xml):

The app also deployed fine, with no errors:

Using the following resources:
  • Mac OS X
  • JBoss 6.0
  • Netbeans 6.8

  • Would someone mind helping me figure out why I get the error? Please let me know if you need further details.
    your web.xml is weird,It contains servlet-mapping for Invoker servlet which is in server.xml normaly . and I dont find suitable url-pattern of servlet-mapping.

    Note : try to avoid Invoker Servlet,It will tie you in certain area
    Hi Seetharaman,

    Thanks for the reply. In order to secure the server, I have left the servlet for the Invoker commented out in the jboss server xml file, and allowed it explicitly in this web app. Unfortunately, this is for a my Advanced Java class and can't get around allowing this. I need to be able to call a servlet explicitly via the browser.
    Hi all,

    I tried to mess with a few things, and am now back to the error i started with:

    2010-03-25 21:55:05,717 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/TiffanyPadilla]] (HDScanner) Servlet /TiffanyPadilla threw load() exception
    java.lang.SecurityException: Restricted class: org.apache.catalina.servlets.InvokerServlet



    Argh! How frustrating!
    Maybe these post might help,

    http://www.coderanch.com/t/477865/JBoss/do-enable-invoker-servlet-JBoss
    http://www.coderanch.com/t/87535/Tomcat/Security-Exception-while-starting-tomcat

    I did not understand why you need to use the invoker-servlet at all.
    Agreed--there's little reason to use the invoker servlet, and good reasons not to. If you need to invoke known servlets, just map them.

    In any case, servlets must be in a package other than the default package.
    Thanks all,

    I appreciate your help. I've actually read and re-read the posts mentioned, but I can't seem to enable invoking my individual servlet. This is just for a class, and running on my Mac, so I'm not worried about security. If someone has another idea about how I can enable the ability to invoke my servlet via browser I would greatly appreciate it. For now, I took your advice and removed the invoker servlet from my web.xml and placed my individual HelloWho servlet in a package called Hello.

    Any other suggestions? I'm still faced with a 404.

    Thanks!
    Did you put the servlet into a package other than the default package, like I mentioned previously?
    Could you post the new web.xml and the URL you are trying to hit. Hope you remember that the URL are CaSe sensitive!
     

    David Newton wrote:Did you put the servlet into a package other than the default package, like I mentioned previously?


    From my last post...

    For now, I took your advice and removed the invoker servlet from my web.xml and placed my individual HelloWho servlet in a package called Hello.

     
     

    Sam Mercs wrote:Could you post the new web.xml and the URL you are trying to hit.



    web.xml

    URL
    http://localhost:8080/TiffanyPadilla/servlet/HelloWho

    Sam Mercs wrote:Hope you remember that the URL are CaSe sensitive!


    I understand case sensitivity. The below error, as provided in the initial post displays the URL I'm entering in the error...

    HTTP Status 404 - /TiffanyPadilla/servlet/HelloWho

     
    I'd like to be able to directly access my servlet via browser, if anyone has an idea how to do that it would be greatly helpful!
    Package names should be all lowercase.

    Where did you put the class file? Without complete information, it's hard to help.
    The URL should be /HelloWho, as the mapping is (if you're deploying to the root context), not /servlet/HelloWho.
    I am going down to the lab. Do NOT let anyone in. Not even this tiny ad:
    Thread Boost - a very different sort of advertising
    https://coderanch.com/t/674455/Thread-Boost-feature


    This thread has been viewed 2325 times.

    All times above are in ranch (not your local) time.
    The current ranch time is
    Apr 26, 2018 19:17:06.