views:

54

answers:

1

Recently, I started to experience strange behaviour in JBOss 4.0.5 JSP application. The JSP compilation fails on first (second, third,..) attempt with exception:

17:24:29,909 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.io.IOException: tmpFile.renameTo(classFile) failed
        at org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:245)
        at org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:164)
        at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:429)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

After few retries (where few is 0 to ~ 7), the page gets eventually compiled and renders OK.

Platform is Windows 7-Pro 64 bit, Java version is

c:\ATG\ATG2007.1>java -version
java version "1.5.0_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_21-b01)
Java HotSpot(TM) Client VM (build 1.5.0_21-b01, mixed mode)

JBoss version:

16:49:51,384 INFO  [Server] Release ID: JBoss [Zion] 4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)

Tomcat version is 5.5 (the one included with JBoss).

Thanks.

+2  A: 

This is related to Tomcat 5.5 bug 38713. It seems to be fixed in Tomcat 5.5.25 onwards.

BalusC
This seems to be pretty old bug. The theory of race condition may be right as there are other people on the team using Windows 7 (albeit not 64 bit Pro) with same JBoss / Tomcat that have no issues.
Miro A.
I tried out upgrading Tomcat inside JBoss 4.0.5 to 5.5.30 - instructions are here: http://itapproaches.blogspot.com/2010/08/upgrading-tomcat-in-jboss-405.html - unfortunately, I still see the error, albeit much much less.
Miro A.