This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

problem running the HelloWorld ! servlet

 
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !!!
 
Ranch Hand
Posts: 5399
1
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..!!!
 
What's brown and sticky? ... a stick. Or a tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic