5 Replies Latest reply: Jul 9, 2013 10:15 AM by 1023688 RSS

    7u21 LiveConnect : Roundtrip call Java->JS->Java raising an exception

    1004212
      Hi,

      We are running a signed & trusted applet that communicates heavily with javascript through DOMService.

      Since 7u21, it looks like calling from Java a Javascript function that interacts back with the applet raises a NullPointerException:

      Exception java.lang.NullPointerException null
           sun.plugin2.applet.Plugin2Manager.checkUntrustedAccess(Unknown Source)
           sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo.isLiveconnectCallAllowed(Unknown Source)
           sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo.doObjectOp(Unknown Source)
           sun.plugin2.main.client.LiveConnectSupport.doObjectOp(Unknown Source)
           sun.plugin2.main.client.MessagePassingJSObject.waitForReply(Unknown Source)
           sun.plugin2.main.client.MessagePassingJSObject.eval(Unknown Source)
           launcher.Browser$2.run(Browser.java:203)
           sun.plugin.dom.DOMService.invokeAndWait(Unknown Source)
           launcher.Browser.executeJavascript(Browser.java:198)

      Anyone experiencing this behavior too ?

      Thanx in advance
        • 1. Re: 7u21 LiveConnect : Roundtrip call Java->JS->Java raising an exception
          1005749
          I have the same issue when Javscript is called from the applet. In the manifest there is the entry "Trusted-Library: true" so that the securtiy warning is not displayed when the Javascript calls the applet.
          • 2. Re: 7u21 LiveConnect : Roundtrip call Java->JS->Java raising an exception
            gimbal2
            1002746 wrote:
            I have the same issue when Javscript is called from the applet. In the manifest there is the entry "Trusted-Library: true" so that the securtiy warning is not displayed when the Javascript calls the applet.
            Do you really get this same exception? This does not merely sound like a security warning, the OP is reporting an NPE crash.
            • 3. Re: 7u21 LiveConnect : Roundtrip call Java->JS->Java raising an exception
              1005749
              Yes. My code is a normal callback to the document window in the applet to my custom javascript function:
              JSObject window = JSObject.getWindow(this);
              return window.eval(methodString);
              • 4. Re: 7u21 LiveConnect : Roundtrip call Java->JS->Java raising an exception
                1005749
                A callback to a "normal" javascript function works. The issue stated above only occurs when the applet calls a javascript function which in turn makes a call to the applet. For example the applet calls a success javascript callback method which makes some GUI stuff in the browser and then calls the applet so that the applet can prepare for the next processing.
                • 5. Re: 7u21 LiveConnect : Roundtrip call Java->JS->Java raising an exception
                  1023688


                  I am also facing the same issue:

                  Exception in thread "Thread-62" java.lang.NullPointerException

                  at sun.plugin2.applet.Plugin2Manager.checkUntrustedAccess(Unknown Source)

                  at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo.isLiveconnectCallAllowed(Unknown Source)

                  at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo.doObjectOp(Unknown Source)

                  at sun.plugin2.main.client.LiveConnectSupport.doObjectOp(Unknown Source)

                  at sun.plugin2.main.client.MessagePassingJSObject.waitForReply(Unknown Source)

                  at sun.plugin2.main.client.MessagePassingJSObject.call(Unknown Source)

                   

                  We are using java compiler as Java6_31 and in browser we are using Java 7 Update 21 . We decompiled the above sun.plugin2.applet.Plugin2Manager.checkUntrustedAccess in Plugin.java to see the Plugin2Manager the method checkUntrustedAccess is not unavalibale in Java6 31 and its present in the Java 7 Plugin.jar.

                   

                  Exception happends when netscape.javascript.jsobject.call(String, arr[]) is called

                   

                  Please can somebody help in this ?