• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat 7 404 Error when accessing application during context reload

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Tyler Wassell
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic