Results 1 to 7 of 7
- 02-26-2013, 10:50 AM #1
Member
- Join Date
- Feb 2013
- Posts
- 4
- Rep Power
- 0
How to prevent applet from InterruptedException when the page is refreshed
Hi Guys,
Is there a way we can prevent an applet from being interrupted when the user navigates away or refreshes the page ?
I am getting the below error whenever the user invokes the applet and navigates away or refreshes the frame.
My requirement is the make the applet complete it action before it is destroyed or stopped.
I am not sure if this problem is due to new java life cycle. I tried setting the legacy_lifetime=true and I got the same error or java.io.IOException when legacy_lifecycle=true
java.lang.NullPointerException
at java.awt.EventQueue.isDispatchThread(EventQueue.ja va:1005)
at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter .runOnEDT(Unknown Source)
at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter .start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
at java.lang.Thread.run(Thread.java:780)
Ignored exception: java.lang.NullPointerException
java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:196)
at sun.plugin2.message.Queue.waitForMessage(Unknown Source)
at sun.plugin2.message.Pipe$2.run(Unknown Source)
at com.sun.deploy.util.Waiter$1.wait(Unknown Source)
at com.sun.deploy.util.Waiter.runAndWait(Unknown Source)
at sun.plugin2.message.Pipe.receive(Unknown Source)
at sun.plugin2.main.client.MessagePassingExecutionCon text.doCookieOp(Unknown Source)
at sun.plugin2.main.client.MessagePassingExecutionCon text.getCookie(Unknown Source)
at sun.plugin2.main.client.PluginCookieSelector.getCo okieFromBrowser(Unknown Source)
at com.sun.deploy.net.cookie.DeployCookieSelector.get CookieInfo(Unknown Source)
at com.sun.deploy.net.cookie.DeployCookieSelector.get (Unknown Source)
at sun.net.http://www.protocol.http.HttpURLConn...ion.java:1192)
at sun.net.http://www.protocol.http.HttpURLConn...tion.java:624)
at sun.net.http://www.protocol.http.HttpURLConn...ion.java:1332)
at com.sun.deploy.net.HttpUtils.followRedirects(Unkno wn Source)
at com.sun.deploy.net.BasicHttpRequest.doRequest(Unkn own Source)
at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX (Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.checkUpd ateAvailable(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.isUpdate Available(Unknown Source)
at com.sun.deploy.cache.DeployCacheHandler.get(Unknow n Source)
at sun.net.http://www.protocol.http.HttpURLConn...tion.java:888)
at sun.net.http://www.protocol.http.HttpURLConn...tion.java:861)
at sun.net.http://www.protocol.http.HttpURLConn...ion.java:1311)
at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Un known Source)
at sun.plugin.PluginURLJarFileCallBack.access$000(Unk nown Source)
at sun.plugin.PluginURLJarFileCallBack$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Access Controller.java:280)
at sun.plugin.PluginURLJarFileCallBack.retrieve(Unkno wn Source)
at sun.net.http://www.protocol.jar.URLJarFile.r...File.java:217)
at sun.net.http://www.protocol.jar.URLJarFile.g...rFile.java:83)
at sun.net.http://www.protocol.jar.JarFileFacto...ctory.java:95)
at sun.net.http://www.protocol.jar.JarURLConnec...tion.java:135)
at sun.net.http://www.protocol.jar.JarURLConnec...tion.java:102)
at com.sun.deploy.security.DeployURLClassPath$JarLoad er.getJarFile(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoad er.access$1000(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoad er$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Access Controller.java:280)
at com.sun.deploy.security.DeployURLClassPath$JarLoad er.ensureOpen(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoad er.<init>(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$3.run(U nknown Source)
at java.security.AccessController.doPrivileged(Access Controller.java:280)
at com.sun.deploy.security.DeployURLClassPath.getLoad er(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getLoad er(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getReso urce(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getReso urce(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknow n Source)
at java.security.AccessController.doPrivileged(Access Controller.java:314)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHel per(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(U nknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(U nknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:6 89)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
at sun.plugin2.applet.Plugin2Manager.initAppletAdapte r(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
at java.lang.Thread.run(Thread.java:780)
Thanks
Sunny
- 02-26-2013, 11:52 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: How to prevent applet from InterruptedException when the page is refreshed
Life cycle of an applet.
If there are things that need to be tidied up then you can override stop() and handle those actions there.
You cannot prevent the applet from being stopped and then destroyed, because the applet is tied to the page. Anything that causes the page to be changed (and this includes reloading) will cause the applet to be unloaded.Please do not ask for code as refusal often offends.
- 02-27-2013, 02:47 AM #3
Member
- Join Date
- Feb 2013
- Posts
- 4
- Rep Power
- 0
Re: How to prevent applet from InterruptedException when the page is refreshed
- 02-27-2013, 09:35 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: How to prevent applet from InterruptedException when the page is refreshed
Have you still got the legacy_lifecycle flag set?
If so then remove that.Please do not ask for code as refusal often offends.
- 02-27-2013, 11:19 AM #5
Member
- Join Date
- Feb 2013
- Posts
- 4
- Rep Power
- 0
Re: How to prevent applet from InterruptedException when the page is refreshed
Yes i have removed the flag since it didn't solve the issue. Currently my applet gets interrupted once the frame is unloaded.
- 02-27-2013, 12:09 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: How to prevent applet from InterruptedException when the page is refreshed
And it's a JRE6 it's running on?
If so, then I'm not sure what's happening.
stop() should be called.Please do not ask for code as refusal often offends.
- 02-28-2013, 08:03 AM #7
Member
- Join Date
- Feb 2013
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
Keylistener not working when screen is constantly refreshed
By evared in forum AWT / SwingReplies: 4Last Post: 08-17-2012, 10:38 PM -
JLabel is not refreshed from withing ActionPerformed
By mavaforumsm in forum AWT / SwingReplies: 2Last Post: 05-25-2010, 05:32 PM -
InterruptedException and Locks
By JavaJuJitZu in forum Threads and SynchronizationReplies: 3Last Post: 02-19-2010, 02:47 AM -
whether this will throw 'InterruptedException' or 'IllegalStateException'
By vysh in forum New To JavaReplies: 2Last Post: 05-28-2009, 05:09 PM -
Error: java.lang.InterruptedException is not caught and does not appear...
By fernando in forum Advanced JavaReplies: 1Last Post: 07-31-2007, 05:52 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks