You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ashima Sharma <as...@gmail.com> on 2012/04/11 17:05:43 UTC

Intermittent "ServletException - Unable to compile class for JSP" for a struts-1.3.10 web-app with Tomcat 7.0.26/7.0.27

We just did a tomcat upgrade (from 6.0.36 to 7.0.26) for a legacy
struts-1.3.10 app on Windows 2008 R2 (64-bit).
Ever since, there's been an intermittent occurence of the following 2
exceptions (for random jsps) -

*2012-04-10 18:27:45,751 ERROR [org.apache.struts.tiles.taglib.InsertTag] -
ServletException in '/WEB-INF/pages/registration/registration.jsp': Unable
to compile class for JSP: *
*An error occurred at line: 49 in the generated java file*
*This method must return a result of type Map<String,Long>*
*
*
*AND*
*
*
*
2012-04-10 18:36:58,501 ERROR [org.apache.struts.tiles.taglib.InsertTag] -
ServletException in '/WEB-INF/pages/registration/registration.jsp':
classFile.delete() failed
org.apache.jasper.JasperException: Unable to compile class for JSP
*
*
*
*
*
We don't precompile the jsps. The related jsps already have the
corresponding .java and .class files in the work folder.

Have researched and found a ton of solution for similar issues with earlier
versions of tomcat. Have tried the following plausible solutions:
1. Made sure that the tomcat install was clean, the work folder was deleted
2. Made sure tomcat has full permissions to the appropriate File/Folders
3. Made sure tomcat is running with development=false
4. Tried with JspServlet setting of fork=true and fork=false
5. Made sure that there's no search/indexing services trying to access
tomcat folders creating access conflict
6. Tried going to the latest version of tomcat 7.0.27

The error still persists. Any thoughts/ideas ...
thanks.

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

Posted by Ashima Sharma <as...@gmail.com>.
Konstantin, responding to your questions:

[What is the type and value of  _jspx_dependants field? ]

*private static java.util.Map<java.lang.String,java.lang.Long>
_jspx_dependants;
It does match the method return type!*

[Can you cite with what parameters "JspServlet" in your web.xml is
configured, exactly?]

    <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>development</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>genStringAsCharArray</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
            <param-name>trimSpaces</param-name>
            <param-value>true</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>

- I believe we have tried the suppressSmap=true setting in our uat
environment, and still seen the 1st exception occur (related to
getDependants).
But I'll retry that and let you know the outcome.

- We have excluded the tomcat folder from anti-virus scans.

- As far as I can tell we don't have any strange jars in this web-app,
definitely no copy of jasper.

- Your question regarding the windows registry settings, let me know what
specific settings do I need to verify and I will do that.

thanks.

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

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Konstantin,

On 4/12/12 12:44 PM, Christopher Schultz wrote:
> Ashima has sent the original JSP and the translated .java file to
> me. The interesting parts are here:

Also, there isn't much in the way of directives in the original JSP.
First, some declarations:

<%@ page trimDirectiveWhitespaces="true" %>
<%@ include file="/WEB-INF/pages/taglibs.jsp" %>

Then after that, it's just using standard JSTL tags. The page looks
fairly clean to me.

If there is A/V in the mix, there might be a problem writing, then
reading, then deleting, then re-naming, etc. all in a short period of
time... it might just be an I/O problem.

- -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+HB6UACgkQ9CaO5/Lv0PCZlgCdHbrAsZGJq/8szkGiukOcOwf5
n24AnjeE0wyTSX0L728wGASYudYhZzW/
=eAxg
-----END PGP SIGNATURE-----

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


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

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Konstantin,

On 4/12/12 10:03 AM, Konstantin Kolinko wrote:
> What is the type and value of  _jspx_dependants field?

Ashima has sent the original JSP and the translated .java file to me.
The interesting parts are here:

  // Starting at line 21 (filenames redacted):
  private static java.util.Map<java.lang.String,java.lang.Long>
_jspx_dependants;


  static {
    _jspx_dependants = new
java.util.HashMap<java.lang.String,java.lang.Long>(12);
    _jspx_dependants.put("/WEB-INF/tld/a.tld",
Long.valueOf(1333128256000L));
    _jspx_dependants.put("/WEB-INF/pages/b.jsp",
Long.valueOf(1333128256000L));
    _jspx_dependants.put("/WEB-INF/tags/c.tag",
Long.valueOf(1333128256000L));
    _jspx_dependants.put("/WEB-INF/tld/d.tld",
Long.valueOf(1333128256000L));
    _jspx_dependants.put("/WEB-INF/tld/e.tld",
Long.valueOf(1333128256000L));
    _jspx_dependants.put("/WEB-INF/tags/f.tag",
Long.valueOf(1333128256000L));
    _jspx_dependants.put("/WEB-INF/tld/g.tld",
Long.valueOf(1333128256000L));
    _jspx_dependants.put("/WEB-INF/tld/h.tld", Long.valueOf(-1L));
    _jspx_dependants.put("/WEB-INF/tld/i.tld",
Long.valueOf(1333128256000L));
    _jspx_dependants.put("/WEB-INF/tld/j.tld",
Long.valueOf(1333128256000L));
    _jspx_dependants.put("/WEB-INF/tld/k.tld",
Long.valueOf(1333128256000L));
    _jspx_dependants.put("/WEB-INF/tld/l.tld",
Long.valueOf(1333128256000L));
  }

  // ...

  // Line 49:
  public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
    return _jspx_dependants;
  }

That looks perfectly legit to me.

> It seems that it complaints that that field returned by the method
> is not Map<String,Long>.
> 
>> Can you confirm that after you try to access the .jsp from the 
>> browser, the timestamp on the .java file changes?
> 
> Timestamp does not matter, because in latest Tomcat 7 it is set to 
> match the original file.
> 
> There is a comment at the top of generated java file that mentions 
> this fact and the actual time of generation.

/*
 * Generated by the Jasper component of Apache Tomcat
 * Version: Apache Tomcat/7.0.26
 * Generated at: 2012-04-12 14:47:59 UTC
 * Note: The last modified time of this file was set to
 *       the last modified time of the source file after
 *       generation to assist with modification tracking.
 */

> 3. Deletion of recently created files on Windows can be impeded by 
> antivirus scanners. (Subversion client users on Windows are
> sometimes complaining about that. It depends on a/v product being
> used.).

It's weird that the .classtmp file does not appear to exist, either.

> Maybe Tomcat can rename the old file before deleting it. IIRC
> Windows allows renaming files that are open for reading, but has 
> problems with deleting them.

The code definitely creates the new file, then deletes, then renames.
Since the delete fails, the rename can't occur. Strange thing is that
the file that should be re-named (.classtmp) does not exist according
to OP.

- -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+HBoYACgkQ9CaO5/Lv0PBQJQCeN1XqxMEBjKh+QtTKDEb9Wi01
DIUAoKauJOoOj4+KW3ATIJioAJLhp7N7
=sHS8
-----END PGP SIGNATURE-----

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


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

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/4/12 Ashima Sharma <as...@gmail.com>:
> 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.
>
> 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-  }
>

> *An error occurred at line: 49 in the generated java file*
> *This method must return a result of type Map<String,Long>*

What is the type and value of  _jspx_dependants field?

It seems that it complaints that that field returned by the method is
not Map<String,Long>.

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

Timestamp does not matter, because in latest Tomcat 7 it is set to
match the original file.

There is a comment at the top of generated java file that mentions
this fact and the actual time of generation.

You can look at "creation time" of the file as provided by NTFS. That
is because a new file is created and then its modification time is set
to the past.


1. Can you cite with what parameters "JspServlet" in your web.xml is
configured, exactly?


> 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 ?

2. It is possible to suppress SMAP generation by setting
"suppressSmap" parameter in JspServlet to "true".

3. Deletion of recently created files on Windows can be impeded by
antivirus scanners. (Subversion client users on Windows are sometimes
complaining about that. It depends on a/v product being used.).

Maybe Tomcat can rename the old file before deleting it.
IIRC Windows allows renaming files that are open for reading, but has
problems with deleting them.


> 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.

On Windows the actual setting the Service starts with are stored in
the registry. I hope those are correct.  I also hope that you do not
have any strange JARs (e.g. a copy of Jasper) in your webapp.

Best regards,
Konstantin Kolinko

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


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

Posted by Ashima Sharma <as...@gmail.com>.
Christopher, response to your questions:

[Can you confirm that after you try to access the .jsp from the
browser, the timestamp on the .java file changes?] -* It does not change.
ALL the .java and .class files have the same timestamp as the .jsp files
which is the same as when the war was deployed.*

[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)?] - *From
a war file. Jsps are not is a jar file. *

*This is a legacy app and has spring + struts...spring is being used for
dependency-injection only, and struts as the web-framework. I should have
mentioned this earlier, but we have other spring based apps (without
struts) on tomcat 7.0.26, and we don't see this issue with those apps. *

[Can you
confirm that you have files called, for example,
userProfileBodyTile_jsp.java, userProfileBodyTile_jsp.class, and
userProfileBodyTile_jsp.javatmp ?]
*The only files that I see under the work directory are .java and .class, I
have not seen any .javatmp files in that directory

*I'll send you registration.jsp and .java files separately. thanks.
----------------------------------------------------------------------------------------------

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

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----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


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

Posted by Ashima Sharma <as...@gmail.com>.
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.

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-  }

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)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
at
org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:684)
at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:678)
at sun.reflect.GeneratedMethodAccessor119.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:129)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:152)
at org.apache.struts.tiles.taglib.InsertTag.doInclude(InsertTag.java:764)
at
org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:896)
at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465)
at
org.apache.jsp.WEB_002dINF.pages.layouts.defaultLayout_jsp._jspx_meth_tiles_005finsert_005f1(defaultLayout_jsp.java:2663)
at
org.apache.jsp.WEB_002dINF.pages.layouts.defaultLayout_jsp._jspService(defaultLayout_jsp.java:253)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1083)
at
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:295)
at
org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:271)
at
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:332)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.advanced.common.web.DisableCachingFilter.doFilterInternal(DisableCachingFilter.java:17)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
com.sacs.casi.oasis.filter.InstitutionNameFilter.doFilterInternal(InstitutionNameFilter.java:38)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
com.sacs.casi.oasis.filter.SecurityFilter.doFilterInternal(SecurityFilter.java:157)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
com.sacs.casi.oasis.filter.AuthorizationFilter.continueProcessing(AuthorizationFilter.java:137)
at
com.sacs.casi.oasis.filter.AuthorizationFilter.doFilterInternal(AuthorizationFilter.java:118)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
com.sacs.casi.oasis.filter.SessionTimeoutFilter.doFilterInternal(SessionTimeoutFilter.java:44)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:75)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:107)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:201)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
com.sacs.casi.oasis.filter.RequestInfoFilter.doFilterInternal(RequestInfoFilter.java:25)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1805)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
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

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

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ashima,

On 4/11/12 11:05 AM, Ashima Sharma wrote:
> We just did a tomcat upgrade (from 6.0.36 to 7.0.26) for a legacy 
> struts-1.3.10 app on Windows 2008 R2 (64-bit). Ever since, there's
> been an intermittent occurence of the following 2 exceptions (for
> random jsps) -
> 
> *2012-04-10 18:27:45,751 ERROR
> [org.apache.struts.tiles.taglib.InsertTag] - ServletException in
> '/WEB-INF/pages/registration/registration.jsp': Unable to compile
> class for JSP: * *An error occurred at line: 49 in the generated
> java file* *This method must return a result of type
> Map<String,Long>*

So, what's on line 49 in regstration_jsp.java?

The JSP compiler is fairly good at reporting information about the
original JSP source, too. Did it give you any clue what the problem was?

When you say "intermittent", do you mean that sometimes the JSP
compiles without a problem and other times it fails? Or, are you
saying that only some of these JSPs have the problem, but it's consistent?

> 2012-04-10 18:36:58,501 ERROR
> [org.apache.struts.tiles.taglib.InsertTag] - ServletException in
> '/WEB-INF/pages/registration/registration.jsp': classFile.delete()
> failed org.apache.jasper.JasperException: Unable to compile class
> for JSP

Full stack trace?

Have you tried tracking-down the problem on line 49 of that file?
Maybe your underlying code changed and the JSP needs to be updated?

- -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+F4pgACgkQ9CaO5/Lv0PAbEwCfTft4iExSXIDNNj5kkBCGDhbj
/fIAn2X/tqJ3GIez2E0mmUPTJlv+mCke
=Z2Xx
-----END PGP SIGNATURE-----

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