8

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.

Miro A.
  • 6,813
  • 2
  • 20
  • 21

3 Answers3

8

Fast forward four years to 2014. Tomcat 8, Java 8, Windows 8, same error. After half a day of frustration it turns out to be caused by my antivirus software, which in my case was McAfee. I went extreme and uninstalled the whole thing. But there was probably some setting I could have made to exclude the Tomcat directories from live scanning.

John Fitzpatrick
  • 3,857
  • 4
  • 44
  • 69
  • Year 2015, same thing, thank you so much, I would have never been able to catch it on my own. I think the cause was I accidentally enabled something on one of the umpteen windows McAfee shows you at one time or another during PC use, but I proceed to uninstall it entirely, as you did, because, you know, to hell with PC manufacturers and their inclusion of some useless antivirus software which is already expired when you start the machine for the first time. – Giulio Piancastelli Jun 04 '15 at 08:45
5

The folder that is throwing IOException is actually read only, after change it to writeable, things are working fine.

Feng Zhang
  • 59
  • 1
  • 1
4

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

BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452
  • 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. Sep 11 '10 at 21:29
  • 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. Sep 11 '10 at 22:35
  • This is still happening when Tomcat 6 is deployed inside of STS 3.3 – anon58192932 Sep 09 '13 at 18:29
  • 1
    Just want to state that I am using Windows 8.1 and Tomcat 7 and am getting this error – IcedDante Mar 10 '14 at 20:31
  • 1
    I am using tomcat-7.0.42 and was getting that error intermittently. It was after I read the comment http://stackoverflow.com/a/14361529/1565521 that I realised that some folder inside tomcat directory was read only. I right clicked on the tomcat-7.0.42 directory and unchecked the read-only box. Things look after doing that. So it is definitely not something related only to Tomcat 5.5 and is affecting later versions too. – atsurti Apr 03 '14 at 00:18