ITeye博客

maven 的jetty 运行时出现无法编辑保存webapp下的文件

slikel · 2012-11-28 09:57 · maven插件 · 编程语言 · Markdown

使用jetty-maven-plugin 在eclipse中进行运行调试,碰到无法编辑保存webapp下的文件

 

提示:请求的操作无法在使用用户映射区域打开的文件上执行

 

解决方法:

 

从 jetty 7 开始,jar存放在maven仓库中的路径为org/eclise/jetty/jetty-webapp

打开对应的版本的jar包

修改jar中的org/mortbay/jetty/webapp/webdefault.xml文件

Java代码

  1. <init-param>
  2. <param-name>useFileMappedBuffer</param-name>
  3. <param-value>true</param-value> <!-- 将这个值设为 false -->
  4. </init-param>

[java] view plaincopyprint?

  1. <init-param>
  2. <param-name>useFileMappedBuffer</param-name>
  3. <param-value>true</param-value> <!-- 将这个值设为 false -->
  4. </init-param>
<init-param>  
  <param-name>useFileMappedBuffer</param-name>  
  <param-value>true</param-value> <!-- 将这个值设为 false -->  
</init-param>  

改好后放回jar包

 

另一种办法是将webdefault.xml 提取出来,修改后放在给定位置,然后配置jetty插件的信息

Java代码

  1. <configuration>
  2. <webAppConfig>
  3. <defaultsDescriptor>src/test/resources/webdefault.xml</defaultsDescriptor>
  4. </webAppConfig>
  5. </configuration>

[java] view plaincopyprint?

  1. <configuration>
  2. <webAppConfig>
  3. <defaultsDescriptor>src/test/resources/webdefault.xml</defaultsDescriptor>
  4. </webAppConfig>
  5. </configuration>
<configuration>	
  <webAppConfig>
    <defaultsDescriptor>src/test/resources/webdefault.xml</defaultsDescriptor>
  </webAppConfig>	
</configuration>

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。