Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Could not delete rwt-resources on shutdown(RWT-Application does not work after shutdown and restart)
Could not delete rwt-resources on shutdown [message #1106669] Wed, 11 September 2013 07:37 Go to next message
Ralf Hantschel is currently offline Ralf Hantschel
Messages: 2
Registered: September 2013
Junior Member
Hi all,

I have an application that is starting a thread that starts a jetty server with an rwt-application inside and stops it after a while. I see the following behavior:

When jetty is stopped I get an exception that some files inside the rwt-resource directory could not be deleted:
2013-09-11 13:26:10.870:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.server.Server@73415727: java.lang.IllegalStateException: Could not delete: C:\Users\Hantschel\workspace\rwt-resource-test\rwt-resources\rap-client.js
java.lang.IllegalStateException: Could not delete: C:\Users\Hantschel\workspace\rwt-resource-test\rwt-resources\rap-client.js
	at org.eclipse.rap.rwt.internal.application.ApplicationContextUtil.deleteFile(ApplicationContextUtil.java:131)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextUtil.doDelete(ApplicationContextUtil.java:118)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextUtil.delete(ApplicationContextUtil.java:94)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextUtil.deleteChildren(ApplicationContextUtil.java:124)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextUtil.doDelete(ApplicationContextUtil.java:116)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextUtil.delete(ApplicationContextUtil.java:94)
	at org.eclipse.rap.rwt.internal.resources.ResourceDirectory.deleteDirectory(ResourceDirectory.java:43)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextActivator.deactivateInstances(ApplicationContextActivator.java:68)


When I now create a new jetty and start it with the RWT-App I get the following exception and the RWT-App does not work any more ('503 Service Unavailable' Error):
013-09-11 13:26:14.510:WARN:oejw.WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,file:/C:/Users/Hantschel/workspace/rwt-resource-test/}
java.lang.RuntimeException: Failed to register resource: rap-client.js
	at org.eclipse.rap.rwt.internal.resources.ResourceManagerImpl.internalRegister(ResourceManagerImpl.java:143)
	at org.eclipse.rap.rwt.internal.resources.ResourceManagerImpl.register(ResourceManagerImpl.java:83)
	at org.eclipse.swt.internal.widgets.displaykit.ClientResources.registerJavascriptResource(ClientResources.java:391)
	at org.eclipse.swt.internal.widgets.displaykit.ClientResources.registerJavascriptFiles(ClientResources.java:342)
	at org.eclipse.swt.internal.widgets.displaykit.ClientResources.registerResources(ClientResources.java:321)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextActivator.activateInstances(ApplicationContextActivator.java:48)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextActivator.access$0(ApplicationContextActivator.java:41)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextActivator$1.run(ApplicationContextActivator.java:36)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextUtil.runWith(ApplicationContextUtil.java:86)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextActivator.activate(ApplicationContextActivator.java:34)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextImpl.doActivate(ApplicationContextImpl.java:258)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextImpl.activate(ApplicationContextImpl.java:131)
	at org.eclipse.rap.rwt.application.ApplicationRunner.activateApplicationContext(ApplicationRunner.java:115)
	at org.eclipse.rap.rwt.application.ApplicationRunner.start(ApplicationRunner.java:83)
	at org.eclipse.rap.rwt.engine.RWTServletContextListener.contextInitialized(RWTServletContextListener.java:49)
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:775)
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:767)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1252)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:710)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at Main$1.run(Main.java:57)
Caused by: 
java.io.FileNotFoundException: C:\Users\Hantschel\workspace\rwt-resource-test\rwt-resources\rap-client.js (Der Vorgang ist bei einer Datei mit einem geƶffneten Bereich, der einem Benutzer zugeordnet ist, nicht anwendbar)
	at java.io.FileOutputStream.open(Native Method)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at org.eclipse.rap.rwt.internal.resources.ResourceManagerImpl.writeResource(ResourceManagerImpl.java:152)
	at org.eclipse.rap.rwt.internal.resources.ResourceManagerImpl.internalRegister(ResourceManagerImpl.java:141)
	at org.eclipse.rap.rwt.internal.resources.ResourceManagerImpl.register(ResourceManagerImpl.java:83)
	at org.eclipse.swt.internal.widgets.displaykit.ClientResources.registerJavascriptResource(ClientResources.java:391)
	at org.eclipse.swt.internal.widgets.displaykit.ClientResources.registerJavascriptFiles(ClientResources.java:342)
	at org.eclipse.swt.internal.widgets.displaykit.ClientResources.registerResources(ClientResources.java:321)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextActivator.activateInstances(ApplicationContextActivator.java:48)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextActivator.access$0(ApplicationContextActivator.java:41)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextActivator$1.run(ApplicationContextActivator.java:36)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextUtil.runWith(ApplicationContextUtil.java:86)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextActivator.activate(ApplicationContextActivator.java:34)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextImpl.doActivate(ApplicationContextImpl.java:258)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextImpl.activate(ApplicationContextImpl.java:131)
	at org.eclipse.rap.rwt.application.ApplicationRunner.activateApplicationContext(ApplicationRunner.java:115)
	at org.eclipse.rap.rwt.application.ApplicationRunner.start(ApplicationRunner.java:83)
	at org.eclipse.rap.rwt.engine.RWTServletContextListener.contextInitialized(RWTServletContextListener.java:49)
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:775)
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:767)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1252)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:710)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)


It looks like the file is somehow still open and can't be deleted because of that.

Any help would be appreciated.

thanks, Ralf
Re: Could not delete rwt-resources on shutdown [message #1107327 is a reply to message #1106669] Thu, 12 September 2013 04:48 Go to previous message
Ralf Hantschel is currently offline Ralf Hantschel
Messages: 2
Registered: September 2013
Junior Member
Hi all,

I have created a small Eclipse project where it's possible to reproduce the issue.
When you start it you can open the ui under
localhost:7070/Example
.

The application starts a jetty. Runs it for 10 seconds and stops it. Then it creates a new jetty and starts it again. To reproduce the issue please open a browser and show the ui. After the jetty has been restartet refresh the browser. On my machine I have to do this 3-4 times until I get the HTTP 503 Error. (Exception on context init is thrown in this case).

Hope someone can help.

regards, Ralf

PS: I have compressed the Web folder in a separate bunch of zip files. Please copy it into the project directory or use the jars you have available on your system.
Previous Topic:GEF default cursor change problem
Next Topic:Could not delete rwt-resources on shutdown
Goto Forum:
  


Current Time: Mon Oct 07 22:38:47 EDT 2013

Powered by FUDForum. Page generated in 0.01740 seconds