Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intermittent Tomcat ClassNotFoundException for some jsp pages

We have two tomcat servers load-balanced behind apache. Several times now we'e gotten reports of a 500 error on a page. Checking shows the following error, but only on one of the tomcats:

java.lang.ClassNotFoundException: org.apache.jsp.jsps.userLogin_jsp
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    etc...

I've tried clearing the work directory and editing the jsp page, with no luck. The only thing that solves it is a tomcat restart, but obviously we need to avoid this kind of solution in production.

Has anyone solved this problem before? My searching has only found questions without answers, including a tomcat bug that was resolved as 'works for me': https://issues.apache.org/bugzilla/show_bug.cgi?id=30450

I'd really appreciate any insight you have. Here is some other info about the project:

  • apache-tomcat-6.0.28
  • java 1.6
  • maven
  • Spring 2.5 (heavy use of MVC with jstl)

Thanks!

like image 836
samspot Avatar asked Oct 21 '10 21:10

samspot


1 Answers

As noted in the comments above, I shouldn't be clearing the Tomcat's work directory while it is running. Thanks guys!

like image 195
samspot Avatar answered Oct 06 '22 01:10

samspot