Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335395 - WIKI: DefaultServlet holds lock on files
Summary: WIKI: DefaultServlet holds lock on files
Status: CLOSED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.2.2   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: 7.2.x   Edit
Assignee: Greg Wilkins CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-25 17:31 EST by Joakim Erdfelt CLA
Modified: 2011-09-20 16:30 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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