my dog learned polymorphism
The moose likes Servlets and the fly likes running a servlet from a new web application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "running a servlet from a new web application" Watch "running a servlet from a new web application" New topic

running a servlet from a new web application

gaurav abbi
Ranch Hand

Joined: Jan 05, 2007
Posts: 108
hi all,
i'm trying to run a servlet from my own web application
but its giving me following error

HTTP Status 404 - /myLearning/servlet/HelloServlet


type Status report

message /myLearning/servlet/HelloServlet

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

i'm giving the following path

and my class file for servlet is placed in this dir structure

i've made the corresponding enteries in web.xml file placed here

and the file is:
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

<web-app xmlns=""


but if i put my class file in ROOT structure
and make the corresponding enteries in web.xml file, it runs fine

i'm not able to figure out whats going wrong.

please reply.

thanks,<br />gaurav abbi
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
I am guessing you are using an old text or tutorial that depends on the dreaded Invoker servlet being configured on your system.

Your web.xml shows that your HelloServlet is not in a package - to avoid future hard to diagnose problems, put ALL classes involved in servlets or JSP in packages and place compiled class files accordingly.

ashok ganesan
Ranch Hand

Joined: Jan 02, 2007
Posts: 50
hi the following link will give you instructions of how to config your TomCat server and running programs.. at the begining even i had same kind of problems i have followed those instructions and got my programming working try it
I agree. Here's the link:
subject: running a servlet from a new web application
It's not a secret anymore!