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.

3 Answers 3

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.

1
  • 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. Jun 4, 2015 at 8:45
5

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

2
  • 2
    How can you tell from the original question which folder it is? Jan 16, 2013 at 15:29
  • 2
    That was exactly what was wrong. I made the root of my application writable with all subfolders and this problem went away. Thanks.
    – max
    Jan 26, 2014 at 5:25
4

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

5
  • 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, 2010 at 21:29
  • I tried out upgrading Tomcat inside JBoss 4.0.5 to 5.5.30 - instructions are here: itapproaches.blogspot.com/2010/08/… - unfortunately, I still see the error, albeit much much less.
    – Miro A.
    Sep 11, 2010 at 22:35
  • This is still happening when Tomcat 6 is deployed inside of STS 3.3 Sep 9, 2013 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, 2014 at 20:31
  • 1
    I am using tomcat-7.0.42 and was getting that error intermittently. It was after I read the comment 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 3, 2014 at 0:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.