Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have recently deployed a corporate public website on Tomcat on a dedicated server. But we are facing a problem. When a jsp resource is requested (for example, index.jsp), most of the times it works well, but sometimes it gives "HTTP Status 404 - Servlet jsp is not available" error (for same index.jsp).

Now we are having difficulties to figure out the possible causes for it. Is there some problem with tomcat configuration? How can we figure out?

Please help.

Thanks Umar

share|improve this question

migrated from stackoverflow.com Sep 29 '09 at 7:57

This question came from our site for professional and enthusiast programmers.

    
can you put more information about your configuration (like is this tomcat fronted with a web server) into this question, and test scenarios under which this is failing. –  Anonymous Sep 29 '09 at 6:51
    
snippets from the logfile would help too... –  KB22 Sep 29 '09 at 6:53
    
Is anything else happening on the server. Files being copied around? Tomcat will restart a web context if you copy new class files to it. Then you will briefly see a 404. –  leonm Sep 29 '09 at 7:02
    
@unkown (yahoo) Test scenario is very simple. Just reload the home page again and again. After some 10-12 reloads, it will give 404 message. –  Umar Sep 29 '09 at 7:14
    
@KB22 which log file should we check in this scenario? I have checked catalina.err. It doesnt contain any recent error? –  Umar Sep 29 '09 at 7:15

3 Answers 3

Usually with tomcat, if you can't find an answer in the log files, you haven't turned up the logging high enough. You can tweak your log4j configuration so that everything is set to DEBUG. You'll probably want to turn particular libraries, like xerces to INFO or even WARN, so they don't drown out the logging you do care about. Your site will slow down as a result of the extra logging, but hopefully it won't be long before your problem occurs.

Let me know if you need help configuring log4j.

share|improve this answer

If you are running Tomcat behind Apache through the AJP connector, it can sometimes happen when you have something that caused a problem with Tomcat. Apache is still running but it has problems connecting via the AJP. So, it displays an error. Try running it directly off Tomcat if you are running it behind Apache.

share|improve this answer

If you haven't configured logging (in which case, you should), then the errors might well be going to stdout and/or to a default log file somewhere. Assuming you are running on a unix-type platform, a simple way to start troubleshooting is to redirect the stdout to a file when starting up

tomcat_start.sh >> stdout.txt 2>&1

or just look at the console when the error happens.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.