Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Could not delete rwt-resources on shutdown
Could not delete rwt-resources on shutdown [message #1106674] Wed, 11 September 2013 11:43 Go to next message
Ralf Hantschel is currently offline Ralf HantschelFriend
Messages: 1
Registered: July 2009
Junior Member
Hi all,

I' experiencing the following problem in my application:

I'm starting a jetty and adding add my RWT application by using the RWTServlet in a Thread. At some point the RWT application should be stopped. I stop the jetty in this case.
Here is my first problem:

I'm getting some exceptions that files in the rwt-resources directory could not be deleted:

2013-09-11 11:16:22.398:INFO:oejsh.ContextHandler:stopped o.e.j.w.WebAppContext{/,file:/C:/Users/Hantschel/workspace/rwt-resource-test/}
2013-09-11 11:16:22.398:WARN:oejuc.AbstractLifeCycle:FAILED o.e.j.w.WebAppContext{/,file:/C:/Users/Hantschel/workspace/rwt-resource-test/}: 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)

Then I want to restart the jetty and init an RWT-App but I get an error during startup and in my Browser there is only a 503 Error:

2013-09-11 11:17:36.726: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:56)
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 for some reason the file is still open by RWT. Can I somehow safely shutdown the RWT-Application? (I already tried to stop the ApplicationRunner but this does not help).

Any help would be appriciated.

thanks, Ralf
Re: Could not delete rwt-resources on shutdown [message #1108292 is a reply to message #1106674] Fri, 13 September 2013 16:36 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 1872
Registered: July 2009
Senior Member
Hi Ralf,
could you provide a simple test project with instructions how to
reproduce it?
Thanks,
Ivan

On 9/11/2013 2:43 PM, Ralf Hantschel wrote:
> Hi all,
>
> I' experiencing the following problem in my application:
>
> I'm starting a jetty and adding add my RWT application by using the
> RWTServlet in a Thread. At some point the RWT application should be
> stopped. I stop the jetty in this case.
> Here is my first problem:
>
> I'm getting some exceptions that files in the rwt-resources directory
> could not be deleted:
>
> 2013-09-11 11:16:22.398:INFO:oejsh.ContextHandler:stopped
> o.e.j.w.WebAppContext{/,file:/C:/Users/Hantschel/workspace/rwt-resource-test/}
> 2013-09-11 11:16:22.398:WARN:oejuc.AbstractLifeCycle:FAILED
> o.e.j.w.WebAppContext{/,file:/C:/Users/Hantschel/workspace/rwt-resource-test/}:
> 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)
>
> Then I want to restart the jetty and init an RWT-App but I get an
> error during startup and in my Browser there is only a 503 Error:
>
> 2013-09-11 11:17:36.726: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:56)
> 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 for some reason the file is still open by RWT. Can I
> somehow safely shutdown the RWT-Application? (I already tried to stop
> the ApplicationRunner but this does not help).
>
> Any help would be appriciated.
>
> thanks, Ralf

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:GEF default cursor change problem
Next Topic:Cannot set osgi property using RAP launcher
Goto Forum:
  


Current Time: Thu Dec 18 00:49:21 GMT 2014

Powered by FUDForum. Page generated in 0.11220 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software