“tmpFile.renameTo(classFile) 失败”的原因JSP编译期间
最近,我开始在 JBOss 4.0.5 JSP 应用程序中遇到奇怪的行为。 JSP 编译在第一次(第二次、第三次……)尝试时失败,但有异常:
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)
经过几次重试(其中几次是 0 到 ~ 7),页面最终被编译并呈现正常。
平台是Windows 7-Pro 64位,Java版本是
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版本:
16:49:51,384 INFO [Server] Release ID: JBoss [Zion] 4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)
Tomcat版本是5.5(JBoss附带的)。
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
快进四年到 2014 年。Tomcat 8、Java 8、Windows 8,同样的错误。经过半天的挫败,结果证明是由我的防病毒软件引起的,在我的例子中是迈克菲。我走极端并卸载了整个东西。但我可能可以进行一些设置来从实时扫描中排除 Tomcat 目录。
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.
抛出 IOException 的文件夹实际上是只读的,将其更改为可写后,一切正常。
The folder that is throwing IOException is actually read only, after change it to writeable, things are working fine.
这与 Tomcat 5.5 错误 38713 相关。 Tomcat 5.5.25 以后似乎已修复。
This is related to Tomcat 5.5 bug 38713. It seems to be fixed in Tomcat 5.5.25 onwards.