• 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:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

HFSJ ServetContext Listener demo, error 404, /listenerTest/ListenTest.do not found

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ranchers!

I am trying to run the ServletContextListener demo from HFSJ, pg 170-177. However, I get an error message when I try to access the url http://localhost:8080/listenerTest/ListenTest.do:

HTTP Status 404 - /listenerTest/ListenTest.do

type Status report

message /listenerTest/ListenTest.do

description The requested resource (/listenerTest/ListenTest.do) is not available.
Apache Tomcat/5.5.25



Tried though I have, I can't find any mistake(s) in my web.xml file. Here it is :



And here is the tomcat directory structure for the app:


C:\Program Files\Apache Software Foundation\Tomcat5.5\webapps\listenerTest>dir /s
Volume in drive C has no label.
Volume Serial Number is 14F1-A032

Directory of C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\listenerTest

11/22/2007 06:29 PM <DIR> .
11/22/2007 06:29 PM <DIR> ..
11/23/2007 06:04 PM <DIR> WEB-INF
1 File(s) 270 bytes

Directory of C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\listenerTest\WEB-INF

11/23/2007 06:04 PM <DIR> .
11/23/2007 06:04 PM <DIR> ..
11/22/2007 06:28 PM <DIR> classes
11/22/2007 06:28 PM <DIR> lib
11/23/2007 06:43 PM 687 web.xml
1 File(s) 687 bytes

Directory of C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\listenerTest\WEB-INF\classes

11/22/2007 06:28 PM <DIR> .
11/22/2007 06:28 PM <DIR> ..
11/22/2007 06:28 PM <DIR> com
0 File(s) 0 bytes

Directory of C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\listenerTest\WEB-INF\classes\com

11/22/2007 06:28 PM <DIR> .
11/22/2007 06:28 PM <DIR> ..
11/23/2007 03:21 PM <DIR> example
0 File(s) 0 bytes

Directory of C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\listenerTest\WEB-INF\classes\com\example

11/23/2007 03:21 PM <DIR> .
11/23/2007 03:21 PM <DIR> ..
11/23/2007 04:52 PM 353 Dog.class
11/23/2007 04:53 PM 1,213 ListenerTester.class
11/23/2007 04:53 PM 837 MyServletContextListener.class
3 File(s) 2,403 bytes

Directory of C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\listenerTest\WEB-INF\lib

11/22/2007 06:28 PM <DIR> .
11/22/2007 06:28 PM <DIR> ..
0 File(s) 0 bytes

Total Files Listed:
5 File(s) 3,360 bytes
17 Dir(s) 2,160,082,944 bytes free




Here are the sources of the java files:

Dog.java



ListenerTester.java



MyServletContextListener.java



Any idea what's wrong?

Thanks in advance for your time!

Aditya
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you looked in the Tomcat logs to see if there were any errors reported?

Also, take a look at the "List Applications" in the Tomcat manager application to see if your app has been deployed.

http://localhost:8080/manager/html
 
Aditya Gopalakrishnan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your time, Ben!

I opened the manager page and the application was listed in the list of deployed applications and there are no errors located in the Tomcat logs.
 
Ranch Hand
Posts: 119
Spring MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the status in the deployed application list state that the application is running?

I am just curious whether the order of the tag in the web.xml matter, like if the context-param should be placed before the servlet configuration
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
The new gardening playing cards kickstarter is now live!
https://www.kickstarter.com/projects/paulwheaton/garden-cards
reply
    Bookmark Topic Watch Topic
  • New Topic