title: tmpFile.renameTo(classFile) failed error
body: <p>Getting following exception while deploying a EAR on Jboss 5.1</p>
  
  <pre><code>java.io.IOException: tmpFile.renameTo(classFile) failed
      org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:246)
      org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:165)
      org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:454)
  </code></pre>
  
  <p>this looks related to this <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=38713" rel="nofollow">bug</a>. Seems like JSP compiler is not able to write the compiled file but <strong><em>this error occurs only for a particular page and not for all JSPs</em></strong>.     </p>
  
  <p>After googling and searching on SO I tried following things<br>
  1. Checked disk space (80+ Gbs are available)<br>
  2. Checked folder write access (Gave full control to all users on jboos folder/tmp/work and deploy)<br>
  3. Updated <code>fork</code> parameter in web.xml to true (<code>C:\jboss-eap-5.1\jboss-as\server\default\deployers\jbossweb.deployer\web.xml</code>)<br>
  4. made sure that the JSP is not open in any other aaplication.<br>
  5. tried restarting/replacing Jboss.<br>
  6. Tried with better net (some people said it occuers on slow net connection)<br>
  7. Also checked that indexing is disabled in <code>web.xml</code></p>
  
  <p>Further details  :<br>
  OS: Windows 7 (64 bit)</p>
  
  <p>Complete stacktrace  </p>
  
  <pre><code>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.tiles.impl.CannotRenderException: JSPException including path '/WEB-INF/view/user/general/dashboard/show.jsp'.
  org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656)
  org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
  org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
  org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:89)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
  org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
  org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
  org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
  org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  root cause
  
  org.apache.tiles.impl.CannotRenderException: JSPException including path '/WEB-INF/view/user/general/dashboard/show.jsp'.
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:692)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
  org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124)
  org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
  org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
  org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
  org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
  org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
  org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
  org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
  org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:89)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
  org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
  org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
  org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
  org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  root cause
  
  org.apache.tiles.util.TilesIOException: JSPException including path '/WEB-INF/view/user/general/dashboard/show.jsp'.
  org.apache.tiles.servlet.context.ServletUtil.wrapServletException(ServletUtil.java:241)
  org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:105)
  org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96)
  org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
  org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
  org.apache.tiles.renderer.impl.ChainedDelegateAttributeRenderer.write(ChainedDelegateAttributeRenderer.java:76)
  org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:336)
  org.apache.tiles.template.InsertAttributeModel.renderAttribute(InsertAttributeModel.java:210)
  org.apache.tiles.template.InsertAttributeModel.end(InsertAttributeModel.java:126)
  org.apache.tiles.jsp.taglib.InsertAttributeTag.doTag(InsertAttributeTag.java:311)
  org.apache.jsp.WEB_002dINF.view.TilesLayoutOnline_jsp._jspx_meth_tiles_005finsertAttribute_005f2(TilesLayoutOnline_jsp.java:527)
  org.apache.jsp.WEB_002dINF.view.TilesLayoutOnline_jsp._jspService(TilesLayoutOnline_jsp.java:201)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241)
  org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222)
  org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
  org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
  org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124)
  org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
  org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
  org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
  org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
  org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
  org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
  org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
  org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:89)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
  org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
  org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
  org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
  org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  root cause
  
  java.io.IOException: tmpFile.renameTo(classFile) failed
  org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:246)
  org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:165)
  org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:454)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:335)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:313)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:300)
  org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
  org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:640)
  org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:634)
  org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:103)
  org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96)
  org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
  org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
  org.apache.tiles.renderer.impl.ChainedDelegateAttributeRenderer.write(ChainedDelegateAttributeRenderer.java:76)
  org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:336)
  org.apache.tiles.template.InsertAttributeModel.renderAttribute(InsertAttributeModel.java:210)
  org.apache.tiles.template.InsertAttributeModel.end(InsertAttributeModel.java:126)
  org.apache.tiles.jsp.taglib.InsertAttributeTag.doTag(InsertAttributeTag.java:311)
  org.apache.jsp.WEB_002dINF.view.TilesLayoutOnline_jsp._jspx_meth_tiles_005finsertAttribute_005f2(TilesLayoutOnline_jsp.java:527)
  org.apache.jsp.WEB_002dINF.view.TilesLayoutOnline_jsp._jspService(TilesLayoutOnline_jsp.java:201)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241)
  org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222)
  org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
  org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627)
  org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
  org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124)
  org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
  org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
  org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
  org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
  org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
  org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
  org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
  org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:89)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
  org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
  org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
  org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
  org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  </code></pre>
  
  <p>Tried every solution mentioned in bug and related SO questions but no luck.</p>
  
  <p><strong>EDIT :</strong><br>
  This exception occurs only on my laptop and that too on random JSPs. Project works fine on some other machines. So looks like to be a machine specific issue rather than coding issue in JSP</p>