tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
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
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ashima,

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 regstration_jsp.java - 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(JspCompilationContext.java:661)

Yup,
> 
that's the compiler.

> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)

Spring
> 
plus Struts? Okay...

> Caused by: java.io.IOException: classFile.delete() failed at 
> org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:201)
>
> 
at org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:163)
> at 
> org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:472)
>
> 
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353) 
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340) 
> at 
> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
>
> 
... 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.java, userProfileBodyTile_jsp.class, and
userProfileBodyTile_jsp.javatmp ?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+F/XYACgkQ9CaO5/Lv0PDrIACfQDK6no4ncxzXnj8gkB4nulnX
iv8AoI6L+FDyBGHF/VfB2LyEtVOQXLDQ
=PQxy
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message