Cannot save file: Cannot delete temporary file ___jb_old___

Hi!

I have a very basic Maven webapp running with Jetty. When I try to save my index.jsp changes, while the jetty server is running, IDEA complains that "Cannot save file: Cannot delete temporary file C:\...\index.jsp.___jb_old___". This does happen just on Windows (I need to stop the server, save my changes, and then restart the server), everything works fine on Linux. How can I fix the problem?


Best.

8 comments
Comment actions Permalink

Volkan,

please see this issue for a workaround.

1
Comment actions Permalink

Thanks Roman for the quick reply. I added -Didea.no.safe.write=true line to C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 11.0\bin\idea.exe.vmoptions file. This time, when I try to save, IntelliJ complains that "Cannot save file: C:\...\index.jsp (The requested operation cannot be performed on a file with a user-mapped section open)". BTW, I'm pretty sure no other applications try to access index.jsp, except IntelliJ.

Hrm... While googling for the new error message, this FAQ I found fixed the problem: http://www.assembla.com/spaces/liftweb/wiki/Fix_file_locking_problem_with_jettyrun

1
Comment actions Permalink

Cannot Save Files problem is still relevant in IDEA 12.1.4


I have tried to use

  1. IDEA / Settings / IDE Settings / General / "Use Safe Write" (Remove flag)


And yes this error dissapear, but error: Cannot Save Files

So currently the solution (at least in Jetty ) is to add server

default</servlet-name>
        <init-param>
            <param-name>useFileMappedBuffer</param-name>
            <param-value>false</param-value>
        </init-param>
</servlet>


It is really a shitty error when we want to work agile with IDEA the webstorm way !!!!!

Because adding this flag to web.xml can cause later problems !!!!!!!

0
Comment actions Permalink

Rather than posting a rude rant on a 2 year old post, it might be more productive to open a regression bug in you track ;)

1
Comment actions Permalink

Anders,

your files are clearly being locked by Tomcat - there's nothing IDEA can do. There are number of anti-locking tricks - e.g.

<Context antiResourceLocking="true">


If nothing else helps I'd suggest to stop using Windows :)

0
Comment actions Permalink

Agree it is a Windows problem. I do not have the problem on my mac.
My client just insists on using Windows.

1
Comment actions Permalink

Close google driver sync.....

0
Comment actions Permalink

I just restarted my pc and it was fine. (using Windows 10)

0

Please sign in to leave a comment.