Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ContextListener stopping context from loading

 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My servlets run fine, until I add...



...immediately after the "<web-app>" tag of my deployment descriptor.

It will work on one server, but not on another server which gives status codes 404 when I send a request to any servlet or even try to retrieve the default index.html page.

I've checked that Servlet API 2.3 is being used on this server, so I do not know what is wrong.

Does anyone have any ideas?

Thanks,
James
 
Vijay Kiran
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are they same servers(Software) ? What is the exat error message?
 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They're both Tomcat 4.1 .

I have looked through the tomcat directories I have access to, but cannot find any error logs pertaining to this problem...
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prior to servlet spec 2.4, the order of the elements in web.xml mattered.
Post your web.xml file.
 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the web.xml contents:

 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apologies - it isn't Tomcat 4.1 (as mentioned above) but Tomcat 4.0.3 .
 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I compared my web.xml file to the one in the 'examples' context, and noticed I need to change my web.xml's first line to:

<?xml version="1.0" encoding="ISO-8859-1"?>

...Problem solved! Cheers for the replies.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic