Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error - HTTP Status 404

 
Chloe Loh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I had installed the tomcat 4.1.18 in my machine,
I configure the system variables as below:
CATALINA_HOME=C:\Tomcat-4.1
JAVA_HOME=C:\jdk1.3.1
I copied HelloWorldServlet.class(one servlet) to C:\Tomcat-4.1\webapps\chapter01\WEB-INF\classes and also its web.xml into the web-inf folder.
and I started tomcat and tried to connect to the URL(http://localhost:8080/chapter01/servlet/HelloWorldServlet).
it gave me this message:
HTTP Status 404 -/chapter01/servlet/HelloWorldServlet.
I did the same thing when I installed tomcat4.0 and it works fine.
I have looked at the tomcat 4.1.18 documentation but still can't get the clue. Hope somebody here can help. Thanks first.....
 
Chloe Loh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just found out the solution on the link as below:
http://www.moreservlets.com/Using-Tomcat-4.html
I've got this resource in javaranch.
Thank you very much.
 
Alfred Kemety
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I followed the tutorial, I un-commented:
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
in the conf/web.xml
but still my HelloWorld is not working, when I copied it to webapp/examples/classes, instead of webapp/ROOT/classes.. it worked fine and no more 404s
What should I do to make it work in the ROOT? and I need explanation to whatever code I will have to add to the web.xml file in the ROOT/WEB-INF directory.... I want to understand and make it work in the same time....
anyone to help??
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you restarted after uncommenting the mapping?

And it would work in the examples application because the web.xml file under examples/WEB-INF already contained a servlet/* mapping.

This was discussed here (start reading posts in the year 2003; ignore the posts from 2002).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic