Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 335395

Summary: WIKI: DefaultServlet holds lock on files
Product: [RT] Jetty Reporter: Joakim Erdfelt <joakim.erdfelt>
Component: serverAssignee: Greg Wilkins <gregw>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: gregw, jetty-inbox, mgorovoy
Version: 7.2.2   
Target Milestone: 7.2.x   
Hardware: PC   
OS: Windows All   
Whiteboard:

Description Joakim Erdfelt CLA 2011-01-25 17:31:01 EST
The DefaultServlet does not release locks on files that it serves.
This prevents the file that has been served (at least once) from being replaced / deleted / renamed / or moved.

Speculation: the DefaultServlet isn't releasing the streams or closing the file handles.

The unit test org.eclipse.jetty.servlet.DefaultServletTest.testWelcomeServlet can be used as the test case for this under Windows.
Comment 1 Michael Gorovoy CLA 2011-01-26 20:31:31 EST
I've been able to reproduced this issue. In one of the applications that I've tried to edit a file with it complains about user-mapped area being open when I try to save the edited file. I will look into this some more tomorrow.
Comment 2 Greg Wilkins CLA 2011-01-30 23:09:07 EST
Is this something more than

http://docs.codehaus.org/display/JETTY/Files+locked+on+Windows

can you also check if that doco has been updated for jetty-7 on the eclipse wiki.
Comment 3 Michael Gorovoy CLA 2011-06-30 10:19:10 EDT
I've confirmed that setting the following parameter for DefaultServlet corrects the issue, as Greg had suggested above.

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

The documentation page above need to be ported to Eclipse WIKI.

-Michael