File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes HTTP Status 404 - /myapps/helloworldservlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP Status 404 - /myapps/helloworldservlet" Watch "HTTP Status 404 - /myapps/helloworldservlet" New topic

HTTP Status 404 - /myapps/helloworldservlet

chandu boyapati

Joined: Nov 01, 2008
Posts: 7
Hello every one,

...I am unable to run simple servlet named "helloworldservlet"

...I created fallowing directory structure


... web.xml :
<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns=""


...I added below lines to $CATALINA_HOME/conf/server.xml

<Context path="/myapps"
reloadable="true" >

...I used below url for accessing the servlet


...I got the below error

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

...some one please help me
vijay kumar dahiya
Ranch Hand

Joined: Oct 19, 2008
Posts: 33
May be Its probelem occur in web.xml.
Container are not able to findout desired servlet in servlet-mapping.
Check your web.xml file.servlet are proper mapped by the URL.??

chandu boyapati

Joined: Nov 01, 2008
Posts: 7
I really appreciate your immediate reply.

yes ... there is a problem some where in the web.xml or in server.xml while
specifying the Context.

I did my level best to identify the error.But I am unable to find the error.

Can you please check the web.xml and server.xml contents (which I provided) and suggest is that is the right way to specify the directories.
Steve Luke

Joined: Jan 28, 2003
Posts: 4181

> $CATALINA_HOME/webapps/myapps/WEB-INF/classes/package1/web.xml

This is the first place to look. The web.xml should be in the WEB-INF directory, not a package under the WEB-INF/classes directory.

chandu boyapati

Joined: Nov 01, 2008
Posts: 7
Thanks man...

As you said I misplaced the web.xml

Now it's working
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

web.xml should be placed under the WEB-INF directory and not inside the package1.

Regards, Sud.
I agree. Here's the link:
subject: HTTP Status 404 - /myapps/helloworldservlet
It's not a secret anymore!