File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Cannot access the HelloWorldServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Cannot access the HelloWorldServlet" Watch "Cannot access the HelloWorldServlet" New topic
Author

Cannot access the HelloWorldServlet

Elinor Chang
Ranch Hand

Joined: Jul 30, 2003
Posts: 58
Okay, this might sound silly, but I just cannot invoke HelloWorldServlet from my newly installed Tomcat (I've never used Tomcat before). Here is what I did:
1. Copy the my.package.HelloWorldServlet to myTool/WEB-INF/classes/my/package
2. Add the following entry to myTool/WEB-INF/web.xml
<servlet>
<servlet-name>HelloWorldServlet</servlet-name>
<servlet-class>my.package.HelloWorldServlet</servlet-class>
</servlet>
3. run bin/startup.sh
4. try to invoke the HellowWorldServlet as the followings:
http://10.131.69.26:8080/myTool/servlet/HelloWorldServlet
5. Got this error message
404 description The requested resource (/myTool/servlet/HelloWorldServlet) is not available.
Did I miss anything?
Thanks


The more I learn, the less I know....<br /> <br />SCJP2 <br />SCWCD
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
What version of Tomcat are you using?
In later versions, the "invoker" servlet is disabled by default. Re-enable it by un-commenting the following lines in your conf/web.xml file:


Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Elinor Chang
Ranch Hand

Joined: Jul 30, 2003
Posts: 58
The invoker is already uncommented. I am using 4.1.27...
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
To make sure the invoker is properly working, can you try this?
http://10.131.69.26:8080/myTool/servlet/my.package.HelloWorldServlet
Also, make sure that all of the elements in your web.xml are in the right order. (I don't know what else you have in there.)
[ August 09, 2003: Message edited by: Ron Newman ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot access the HelloWorldServlet