0 Replies Latest reply: Feb 26, 2013 3:42 AM by 993368 RSS

    How to prevent applet from InterruptedException when the page is refreshed

    993368
      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.java: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$AppletExecutionRunnable.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.MessagePassingExecutionContext.doCookieOp(Unknown Source)
           at sun.plugin2.main.client.MessagePassingExecutionContext.getCookie(Unknown Source)
           at sun.plugin2.main.client.PluginCookieSelector.getCookieFromBrowser(Unknown Source)
           at com.sun.deploy.net.cookie.DeployCookieSelector.getCookieInfo(Unknown Source)
           at com.sun.deploy.net.cookie.DeployCookieSelector.get(Unknown Source)
           at sun.net.www.protocol.http.HttpURLConnection.setCookieHeader(HttpURLConnection.java:1192)
           at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:624)
           at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1332)
           at com.sun.deploy.net.HttpUtils.followRedirects(Unknown Source)
           at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
           at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
           at com.sun.deploy.cache.ResourceProviderImpl.checkUpdateAvailable(Unknown Source)
           at com.sun.deploy.cache.ResourceProviderImpl.isUpdateAvailable(Unknown Source)
           at com.sun.deploy.cache.DeployCacheHandler.get(Unknown Source)
           at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:888)
           at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:861)
           at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1311)
           at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Unknown Source)
           at sun.plugin.PluginURLJarFileCallBack.access$000(Unknown Source)
           at sun.plugin.PluginURLJarFileCallBack$1.run(Unknown Source)
           at java.security.AccessController.doPrivileged(AccessController.java:280)
           at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
           at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:217)
           at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:83)
           at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:95)
           at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:135)
           at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:102)
           at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
           at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source)
           at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
           at java.security.AccessController.doPrivileged(AccessController.java:280)
           at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
           at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
           at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
           at java.security.AccessController.doPrivileged(AccessController.java:280)
           at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
           at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
           at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
           at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
           at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
           at java.security.AccessController.doPrivileged(AccessController.java:314)
           at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
           at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
           at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
           at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
           at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
           at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
           at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:689)
           at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
           at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
           at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
           at java.lang.Thread.run(Thread.java:780)

      Thanks
      Sunny

      Edited by: user10728422 on Feb 26, 2013 1:42 AM