6

I'm using Jetty 6 server and sometimes this exception shows up:

java.io.IOException: tmpFile.renameTo(classFile) failed
    at org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:235)
    at org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:158)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:390)
    at org.apache.jasper.compiler.Compiler.__compile(Compiler.java:437)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:608)

Can this be solved by updating Jetty, or does exist any other way?

Similar but not-for-jetty questions: Cause of 'tmpFile.renameTo(classFile) failed' during JSP compilation, http://dev.eclipse.org/mhonarc/lists/jetty-users/msg02301.html .

Thanks.

Community
  • 1
  • 1
Xdg
  • 1,735
  • 2
  • 27
  • 42
  • This probably isn't enough information for anyone on SO to solve. It might be (in decreasing order of likelihood) a permission issue, or a race condition where for some reason the `tmpFile` gets deleted too quickly, or filesystem corruption, or whatever. – millimoose Sep 16 '13 at 11:17
  • I'm sorry:( I was thinking about that's a Jetty 6 bug. I don't have any other information to write down:( – Xdg Sep 16 '13 at 11:19
  • 1
    It might be a bug but this isn't Jetty 6 support. And even they would need more information than that, except maybe they could actually tell you what would help them. (For starters, when running the server in a debugger, finding out: what paths `tmpFile` and `classFile` are, whether the source file exists, whether the target file does not but its parent directory does, is the source readable to the user Jetty is running as, is the target writeable? Some might not even need debugging if they're already being logged by Jasper at a low priority.) – millimoose Sep 16 '13 at 11:22
  • In this question - http://stackoverflow.com/questions/3688624/cause-of-tmpfile-renametoclassfile-failed-during-jsp-compilation/18825209?noredirect=1#comment27770543_18825209 - it was a bug in Tomcat. So now when we're sure that there is no bug in Jetty 6, I can find out these information :-) – Xdg Sep 16 '13 at 11:24
  • 1
    In that question it was a bug in Jasper, which is the only JSP engine anyone uses anyway. Quite possibly Jetty 6 still uses that version of Jasper. Try switching to Jetty 7 to see if that makes the error disappear? – millimoose Sep 16 '13 at 11:29
  • What I don't understand is that I started server twice and got this error. After the third restart there is no error. But I know there will be an error tomorrow - it's totally nondeterministic error. – Xdg Sep 16 '13 at 11:36
  • 1
    Jetty 6 is very old, and uses an ancient Jasper version. The most current release of Jetty is 9.0.5 (about 150 releases since the last release of Jetty 6) – Joakim Erdfelt Sep 16 '13 at 16:46

3 Answers3

2

Try to disable indexing tools, virus scanners and so on for .jsp files.

Gernot
  • 1,094
  • 4
  • 25
  • 39
2

I was using eclipse and in my case the issue was resolved by just reloading the page once again. The issue occurs first time, but on reloading the page once again I do not see the error.

Lalit Rane
  • 850
  • 10
  • 16
0

This issue can be resolved by just deleting the temp and deployment folders once. Do a fresh deployment and this will work.

  • You should really add some explanation as to why this should work - you can also add code as well as the comments in the code itself - in its current form, it does not provide any explanation which can help the rest of the community to understand what you did to solve/answer the question. This is especially important for an older question and the questions that already have answers. – ishmaelMakitla Sep 09 '16 at 13:53