This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Aditya Gopalakrishnan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Wayan Saryada
Ranch Hand
Posts: 105
IntelliJ IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!