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.

For some reason, it appears Tomcat is trying to hit its compilation cache when compilation failed.

For example, if I create a JSP containing nothing but Hello, <%=world%>!, predictably, I get an error: org.apache.jasper.JasperException: Unable to compile class for JSP. Subsequent requests however alternate between this and org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP.

Further, if I create a JSP containing Hello!, it of course works just fine. If I modify it contain Hello, <%=name%>!, the response alternates between the previously-mentioned compilation error, and the cached Hello!.

What's going on?

share|improve this question
1  
Doesn't this belong on StackOverflow? –  ripper234 Feb 16 '10 at 17:36
add comment

1 Answer 1

up vote 0 down vote accepted

I finally found a solution. Apparently, JSPs are checked every interval for changes for performance reasons. It is possible to configure Tomcat to check on every request instead.

In web.xml, look for:

<servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>

and add:

    <init-param>
        <param-name>development</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>modificationTestInterval</param-name>
        <param-value>0</param-value>
    </init-param>

Credit to albert's blog for pointing me in the right direction.

EDIT: I also found this bug, which seems to suggest that some buggy behaviour on the part of Tomcat is involved.

share|improve this answer
add comment

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.