Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem running the HelloWorld ! servlet

 
chi Lin
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just start reading manning book, but I
have problem running the HelloWorld ! servlet from the book.
the following are things I did :
1. download tomcat 4.1.18 from apache, install it under c:\jakarta-tomcat-4.1.18.
2. setup some parameter in the autoexec.bat :
SET CATALINA_HOME=C:\jakarta-tomcat-4.1.18
SET JAVA_HOME=C:\jdk1.3.1_04
SET CLASSPATH=%CLASSPATH%;c:\jakarta-tomcat-4.1.18\common\lib\servlet.jar
3. when I start tomcat and point my browser to
http://localhost:8080, I can see the page indciating i have installed Tomcat successfully.
When I copy the chapter01 folder from accompanying CD into c:\jakarta-tomcat-4.1.18\webapps folder then point the browser to
http://localhost:8080/chapter01/servlet/HelloWorldServlet
I got a mesg like
type Status report
message /chapter01/servlet/HelloWorldServlet
description The requested resource (/chapter01/servlet/HelloWorldServlet) is not available.
what did i do wrong ??? please help
[ January 21, 2003: Message edited by: chi Lin ]
[ January 21, 2003: Message edited by: chi Lin ]
[ January 21, 2003: Message edited by: chi Lin ]
 
Srinivas M
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to uncomment the following code in the web.xml file under <your tomcat install folder>/conf
Look for the following lines and uncomment the lines related to the invoker servlet
<!-- The mapping for the invoker servlet -->
<!--
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
-->
Now restart your tomcat server and test the example using the URL
http://localhost:8080/chapter01/servlet/HelloWorldServlet
It will work for you now.
Srinivas
 
chi Lin
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Srinivas,
Thanks for the advice, it is working now (although
I don't really know why).
thanks for the help !!!
 
R K Singh
Ranch Hand
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by chi Lin:
although I don't really know why

Beacuse lines were commented and not being parsed by web.xml parser.
 
shweta mathur
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also have the same problem as Chi Lin.
I checked my web.xml but The mapping for the invoker servlet is already uncommented.
<!-- The mapping for the invoker servlet -->
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
Also when I try to execute the examples given in Tomcat . They all work fine for me .!!
http://localhost:8085/examples/servlet/HelloWorldExample
is working fine for me.
----------------------------------------------------
Can anybody tell what may be the problem that
when I give
http://localhost:8085/chapter01/servlet/HelloWorldServlet
I get the following
type Status report
message /chapter01/servlet/HelloWorldServlet
description The requested resource (/chapter01/servlet/HelloWorldServlet) is not available.
----------------------------------------------------
I have copied the chapter01 folder from CD to webapps folder.
Note : My HTTP port is 8085. I have changed the port in server.xml
Any help will be appreciated, as I am stucked here in the start itself !!!
 
shweta mathur
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oooohhh!!! I didn't restart the server after copying the folder & that was the reason why it was not working..!!!
Itz working fine now..!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic