tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Intermittent "ServletException - Unable to compile class for JSP" for a struts-1.3.10 web-app with Tomcat 7.0.26/7.0.27
Date Wed, 11 Apr 2012 21:53:58 GMT
Hash: SHA1


On 4/11/12 4:27 PM, Ashima Sharma wrote:
> Most of the jsps have this issue...but it happens randomly. For
> e.g., i wd be able to access the registration page 5 times w/o any
> issue, and the 6th time I'd get this error. Its bizarre that tomcat
> tries to recompile the already compiled jsp at some random point
> even though the page hasn't changed, and throws the cannot compile
> error. All the jsps with this issue have the .java and .class
> files under the work directory.

Can you confirm that after you try to access the .jsp from the
browser, the timestamp on the .java file changes?

Are you deploying from a WAR file or exploded directory? Also, are any
of your JSPs in a .jar file (whether this is in a WAR file or not)?

There have been some recent reports of constant recompilation when
JSPs are in ZIP archives (and both .jar and .war are just .zip files
with certain expected entries within them).

> The compilation issue is in
> org.apache.jasper.runtime.JspSourceDependent.getDependants method
> for every jsp in - line 49-  public
> java.util.Map<java.lang.String,java.lang.Long> getDependants() { 
> line 50-    return _jspx_dependants; line 51-  }

Hmm, that looks like Tomcat is not generating good Java code. Would
you be able to post the entire .java file and the original .jsp? I
understand if that's not something you want to post publicly, so you
could email it directly to me if you feel better about that.

I read that you have performed a clean install of Tomcat, which is a
good step to take because this looks like a mismatched Jasper problem
or something.

> For the 2nd exception, this is what the stack trace looks like no
> matter which jsp:
> 2012-04-04 09:55:26,022 ERROR
> [org.apache.struts.tiles.taglib.InsertTag] - ServletException in
> '/WEB-INF/pages/register/userProfileBodyTile.jsp': 
> classFile.delete() failed org.apache.jasper.JasperException: Unable
> to compile class for JSP at 
> org.apache.jasper.JspCompilationContext.compile(

that's the compiler.

> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(

plus Struts? Okay...

> Caused by: classFile.delete() failed at 
> org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(
at org.apache.jasper.compiler.SmapUtil.installSmap(
> at 
> org.apache.jasper.compiler.JDTCompiler.generateClass(
at org.apache.jasper.compiler.Compiler.compile(
> at org.apache.jasper.compiler.Compiler.compile( 
> at org.apache.jasper.compiler.Compiler.compile( 
> at 
> org.apache.jasper.JspCompilationContext.compile(
... 110 more

This error happens when the original .class file can't be deleted
before re-naming an SMAP-loaded copy of the .class file. Can you
confirm that you have files called, for example,, userProfileBodyTile_jsp.class, and
userProfileBodyTile_jsp.javatmp ?

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message