4 Replies Latest reply on Mar 2, 2006 5:40 PM by twick

    JSP Compiler error

    p2auljr

      I sometimes getting the following JSP compiler error when running on Windows XP Professional:

      java.io.IOException: tmpFile.renameTo(classFile) failed
      at org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.jav
      a:245)
      at org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:164)
      at org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java
      :267)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext
      .java:556)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
      .java:293)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
      14)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

      If I hit refresh the JSP page than compiles. Does anyone know if this is a known issue?

        • 1. Re: JSP Compiler error
          twick

          I've recently started having the same problem, usually happens after a fresh build/deploy. My workaround was to modify the SmapUtil class. If the rename fails on the first try, it waits 50ms then retries (loops as needed). So far it always works on the second try after the 50ms delay.

          • 2. Re: JSP Compiler error
            p2auljr

            Do you have a virus scan running on your machine? The reason I ask is that my guess is that this is an operating system level issue. On windows, if I am viewing a file in Word and try to rename , delete, or move it, I get a windows error message. I am guessing that perhaps some other process outside of JBOSS might be trying to read the file and a race condition can sometimes occur.

            • 3. Re: JSP Compiler error
              twick

              Thats the same thing we've been thinking here is that its an OS level issue, not actually a JBoss problem. Symantec antivirus is running, but after disabling all the symantec related services and turning off the auto-protect, the issue was still there. Maybe it needs to be completely uninstalled or its another program causing the problem.

              The SmapUtil code causing the problem basically does
              copy A -> B
              <other stuff here>
              delete A
              rename B -> A

              and according to some documentation with Java in Windows, the rename will fail if the filename you are trying to rename to already exists, which makes me think the delete is being slightly delayed for some reason. With my code change to:

              delete A
              pause 50ms
              rename B -> A

              the problem does not show up.

              • 4. Re: JSP Compiler error
                twick

                After a complete uninstall of symantec, the issue seems to have disappeared during my limited testing.