使用jetty-maven-plugin 在eclipse中进行运行调试,碰到无法编辑保存webapp下的文件
提示:请求的操作无法在使用用户映射区域打开的文件上执行
解决方法:
从 jetty 7 开始,jar存放在maven仓库中的路径为org/eclise/jetty/jetty-webapp
打开对应的版本的jar包
修改jar中的org/mortbay/jetty/webapp/webdefault.xml文件
<init-param>
<param-name>useFileMappedBuffer</param-name>
<param-value>true</param-value> <!-- 将这个值设为 false -->
</init-param>
改好后放回jar包
另一种办法是将webdefault.xml 提取出来,修改后放在给定位置,然后配置jetty插件的信息
<configuration>
<webAppConfig>
<defaultsDescriptor>src/test/resources/webdefault.xml</defaultsDescriptor>
</webAppConfig>
</configuration>
原贴 http://docs.codehaus.org/display/JETTY/Files+locked+on+Windows
本文介绍了解决在使用Jetty进行调试时遇到的文件锁定问题的方法。通过修改jetty-webapp的webdefault.xml文件中的useFileMappedBuffer参数,或者自定义webdefault.xml并配置到Jetty插件中,可以避免在Eclipse中调试时文件被锁定。
168万+

被折叠的 条评论
为什么被折叠?



