• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Apache Tomcat/4.0.1 - HTTP Status 404

Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I am running a servlet using Tomcat 4.0.1 on Windows XP Professional.
The servlet is called Conti and resides in the following directory structure
on my home pc: C:\jakarta-tomcat-4.0.1\webapps\conti\WEB-INF\classes
I have created a web.xml file which does have the correct servlet name in the servlet tags as shown here:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
The servlet compiles with no errors.
When i enter the following url in my address bar: http://localhost:8080/conti/servlet/Conti
I recieve the following error:
Apache Tomcat/4.0.1 - HTTP Status 404 - /conti/servlet/Conti
type Status report
message /conti/servlet/Conti
description The requested resource (/conti/servlet/Conti) is not available.

I have recompiled my servlet and restarted Tomcat several times already.
Could someone please help me.
Fathima Khan.
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you done servlet mapping in you deployment descriptor(web.xml)? if not do it as following
and now try to run the servlet using http://localhost:8080/conti
may be this will help.
Author and all-around good cowpoke
Posts: 13078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. For best results, do NOT leave your class in the default package like this:

Put your class in a package and declare it properly.

2. Don't use the /servlet style of URL - see this FAQ discussion of the invoker servlet.
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think William is right in the observation. even I had faced the same problems in Tomcat when I had put my classes in the default package. creating a separate package solved the issue.
The only cure for that is hours of television radiation. And this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic