File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes ContextListener stopping context from loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "ContextListener stopping context from loading" Watch "ContextListener stopping context from loading" New topic
Author

ContextListener stopping context from loading

James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
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

Joined: Nov 18, 2004
Posts: 21
Are they same servers(Software) ? What is the exat error message?


Vijay<br />I blog, therefore I am<br /><a href="http://www.vijaykiran.com" target="_blank" rel="nofollow">www.VijayKiran.com</a>
James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
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

Joined: Dec 11, 2004
Posts: 13410

Prior to servlet spec 2.4, the order of the elements in web.xml mattered.
Post your web.xml file.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
Here is the web.xml contents:

James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
Apologies - it isn't Tomcat 4.1 (as mentioned above) but Tomcat 4.0.3 .
James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ContextListener stopping context from loading