This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Question about example in SCWCD Exam Study Kit

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just started reading 'SCWD Exam Study Kit.' I'm trying to get the hello world servlet to work in the first chapter, but Tomcat 5 gives me the message "The requested resource (/chapter01/servlet/HelloWorldServlet) is not available." What am I missing?
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If there was a problem parsing your web.xml deployment descriptor (or any of several other problems) Tomcat won't load your web-app, so the servlet won't "exist". Error messages go into the logs in the TomcatDirectory/logs directory... check for any error stack traces related to your application.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am new to New to java. I am getting the same problem. My log is showing the meessages

INFO: JK: ajp13 listening on /0.0.0.0:8009
Jun 21, 2005 11:09:28 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/140 config=null
Jun 21, 2005 11:09:28 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Jun 21, 2005 11:09:29 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2953 ms
Jun 21, 2005 11:56:33 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/chapter01]

I am using the example from the book. Thanks in advcance for any help.
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

This happens when we use the Tomcat 5 or later. The reason is the default sevlet handling invoke servlet is disabled for this versions. so the url os the type ..../servlet/somservlet will not execute by default. We have to define the <servlet-mapping> in the web.xml for the servlet. Without <servlet-mapping> it will not map the servlet to URL.

Yo can uncomment the default Invoker servlet which define the mapping <servlet-mapping>/servlet/*</servlet-mapping>. I had tried this, but I forgot where I had uncommented this. ( I think in default web.xml)

Thanks
 
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic