my dog learned polymorphism*
The moose likes Tomcat and the fly likes Tomcat 7 404 Error when accessing application during context reload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 7 404 Error when accessing application during context reload" Watch "Tomcat 7 404 Error when accessing application during context reload" New topic
Author

Tomcat 7 404 Error when accessing application during context reload

Tyler Wassell
Greenhorn

Joined: Dec 09, 2011
Posts: 8
I am upgrading to Tomcat 7 and testing some things out. I have an environment in which classes are recompiled often and deployed to the server causing Tomcat to reload fairly often. This has all worked great in Tomcat 5 and Tomcat 6.

In Tomcat 7 if I try to access a class (servlet) in a particular servlet context via a web browser while tomcat is in the process of reloading the context, I get an HTTP Status 404 error. In the previous versions of Tomcat, if I tried to access a servlet while tomcat is reloading, this did not happen. Instead it appeared that Tomcat was still able to accept the request, wait until the context has finished loading and then process the request finally returning the desired response to the browser (no error).

I see that someone reported this exact same bug for Tomcat 6 and it was eventually was resolved in a later version: https://issues.apache.org/bugzilla/show_bug.cgi?id=43683. Can anyone tell me if they have seen this in Tomcat 7 or if they have any recommendations on some config or fix that may help me resolve this? Perhaps this is something that once again is a bug that needs to be addressed?

Thanks,
Tyler
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

I obviously have a copy of the "buggy" Tomcat 6, then. I've been taking it as a given that when I do a hot-redeploy there will be a period when the app is unavailable. After all, the actual process is that the old copy of the app is shut down, then the new copy is started up, and there will be a short period of time when the app effectively isn't there. Since I'm far more likely to get caught by the PermGenSpace issue, I never thought twice about it.

With the addition of versioning support in Tomcat7, I can see how that might be different, though.


Customer surveys are for companies who didn't pay proper attention to begin with.
Tyler Wassell
Greenhorn

Joined: Dec 09, 2011
Posts: 8
Thanks for the response. Regarding your PermGenSpace comment, I was plagued by that for the longest time and even upgrading to Tomcat 7 did not resolve it though is seems it may have helped a little. I know there are many different causes of PermGen errors but I finally seemed to resolve mine by moving my jdbc drivers out of the application context (WEB-INF/lib) and into Tomcat/lib. Have not received a PermGen error since.

Hopefully there is something that can be done about the Tomcat 7 context reload 404 error though! That is definitely going to be a problem for me.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat 7 404 Error when accessing application during context reload
 
Similar Threads
tomcat 5 auto reload : Missing web.xml
newbie to Tomcat ??
Tomcat 7 application deployment problem
tomcat 400 error on default page
Severe: Memory leak. I am getting this error.