2013-05-13 118 views
0

我正在用自定义码头集装箱的一个开发模式GWT应用程序。该应用程序加载罚款的第一次,但是,如果我刷新它,我得到的发展模式窗口下面的错误(路径变更):GWT开发模式的问题

00:16:44.854 [ERROR] Unable to create file 'C:\somePath\src\war\msjavaSnack\C4EA130FD0ED44BE513FEEDDE13614DA.cache.png' 
java.io.FileNotFoundException: C:\somePath\src\war\msjavaSnack\C4EA130FD0ED44BE513FEEDDE13614DA.cache.png (The requested operation cannot be performed on a file with a user-mapped section open) 
at java.io.FileOutputStream.open(Native Method) 
at java.io.FileOutputStream.<init>(FileOutputStream.java:194) 
at java.io.FileOutputStream.<init>(FileOutputStream.java:145) 
at com.google.gwt.core.ext.linker.impl.StandardLinkerContext.writeArtifactToFile(StandardLinkerContext.java:658) 
at com.google.gwt.core.ext.linker.impl.StandardLinkerContext.produceOutputDirectory(StandardLinkerContext.java:595) 
at com.google.gwt.dev.DevMode.produceOutput(DevMode.java:476) 
at com.google.gwt.dev.DevModeBase.relink(DevModeBase.java:1131) 
at com.google.gwt.dev.DevModeBase.access$000(DevModeBase.java:67) 
at com.google.gwt.dev.DevModeBase$2.accept(DevModeBase.java:1076) 
at com.google.gwt.dev.shell.ShellModuleSpaceHost$1.accept(ShellModuleSpaceHost.java:122) 
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:59) 
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:154) 
at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:119) 
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:531) 
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:414) 
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:39) 
at com.google.gwt.core.client.GWT.create(GWT.java:98) 
at com.extjs.gxt.ui.client.GXT.<clinit>(GXT.java:38) 
at com.extjs.gxt.ui.client.widget.Component.<clinit>(Component.java:202) 
at msjava.snack.gui.client.MSHeaderPanelViewport.<init>(MSHeaderPanelViewport.java:62) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:422) 
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:361) 
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:185) 
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:380) 
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222) 
at java.lang.Thread.run(Thread.java:662) 

UPDATE

在ProcessExplorer我可以看到托管Jetty的JVM进程有一个打开的文件句柄,所以这可能是其他JVM(托管dev模式)无法写入文件的原因。任何方式来解决它?

+0

你有一个防病毒? (哦,在Windows上,你应该,但你应该禁用它为您的工作空间) – 2013-05-13 14:30:26

回答

0

,我发现这个页面上的解决方案:

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

编辑:

上面的网址现在已经死了。

现在,它很容易找到码头的wiki解决方案:

码头提供了webdefault.xml文件中的配置开关 ,允许或禁止使用的内存映射 文件DefaultServlet。如果您在Windows上运行,并且具有文件锁定 的问题,您应该将此开关设置为禁用内存映射文件 缓冲区。

默认的webdefault.xml文件在位于org/eclipse/jetty/webapp/webdefault.xml的 的lib/jetty.jar中。它解压到一个方便 磁盘位置,并对其进行编辑以useFileMappedBuffer更改为false。

https://wiki.eclipse.org/Jetty/Howto/Deal_with_Locked_Windows_Files

+0

能否请您发布的内容,这种解决办法?链接被破坏。 – Navigateur 2015-07-04 21:05:37

+0

我编辑了答案 – milosz 2015-07-06 12:36:08

+0

真棒,谢谢 – Navigateur 2015-07-06 12:47:28

0

看来,两(开/关)(开/关)rutines在同一文件太快了一个又一个原因,这个......一些开发商提出来调用GC发生。检查每个I/O操作是否正确关闭。不要太快地执行完成(打开,循环(写入),关闭)。看起来,当一个操作将在第二个请求到达时完成并引发问题。