Message-ID: <1712386913.771.1427414480111.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_770_25199783.1427414480111" ------=_Part_770_25199783.1427414480111 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Jetty buffers static content for webapps such as html files, css files, = images etc and uses memory mapped files to do this if the NIO connectors ar= e being used. The problem is that on Windows, memory mapping a file causes = the file to be locked, so that the file cannot be updated or replaced. See = Sun bug: http://bugs.sun.com/bugdata= base/view_bug.do?bug_id=3D4715154. This means that effectively you have= to stop Jetty in order to update a file.
Jetty provides a configuration switch in the
file for the
DefaultServlet which enables or disables the use=
of memory mapped files. If you are running on Windows and are having file =
locking problems, you should set this switch to disable memory mapped file =
webdefault.xml file is found in the
tract it to a convenient disk location and edit it to change
Then, ensure that your custom webdefault.xml file is applied to all of y=
our webapps. You can do that by changing the configuration of the WebAppDep=
Alternatively, if you have individually configured your webapps with con=
text xml files, you need to call the
tor(String path) method:
A WebAppContext can be forced to always copy a web app directory on depl=
oyment to avoid the file locking issue.
This can be set in a context = deployment file as follows:
It seems one can also configure the default jetty Servlet directly in th= e web.xml. For example:
...Altough, it may completely redefine the default servlet configuration= (not sure about that, if anyone can confirm). You could anyway simply extr= act the webdefault file as explained above, and copy-paste th complete defa= ult servlet definition in your web.xml, changing that useFileMappedBuffer p= arameter to false.