Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8175061

JavaScript call Java fail on x86 (32bit) but 64bit,response as TypeError; call Java-function is undefined

XMLWordPrintable

    • web
    • x86
    • windows

      FULL PRODUCT VERSION :
      1.8.0_121-b13, BASE:32


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.2.9200]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      x64 processor,

      A DESCRIPTION OF THE PROBLEM :
      It happen on newer x86-32bit JVM,never happen on x86-64bit.
      we use WebView and WebEngine to process web content.
      when JavaScript call Java method on x86 (32bit), javascript catch a response as TypeError; call Java-function is undefined,same code still work on 1.8.0_65-b17(x86-32bit JVM).
      This class contain IO and security, crypto packages.

      ADDITIONAL REGRESSION INFORMATION:
      javascript call java method fail: 1.8.0_121-b13, BASE:32
      javascript call java method success: 1.8.0_65-b17, BASE:32
      javascript call java method success: 1.8.0_112-b15, BASE:64

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      java:
      JSObject can setMember to let javascript call
      after Worker.State.SUCCEEDED

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      javascript can call java method.
      ACTUAL -
      javascript catch bellow:
      TypeError: appFx.setPKCS11Config() is not a function.(In 'appFx.setPKCS11Config()', 'appFx.setPKCS11Config' is undefined

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      if (newState == Worker.State.SUCCEEDED) {
      try {
      Document doc = webView.getEngine().getDocument();
      //Document doc = webEngine.getDocument();
      Element el = doc.getElementById("pinCode");
      JSObject jso = (JSObject) webView.getEngine().executeScript("window");
      //JSObject jso = (JSObject) webEngine.executeScript("window");
      if(el!=null && ("password").equalsIgnoreCase(el.getAttribute("type"))){
      jso.setMember("appFx", new ClientBridge(dommain,true));
      jso.call("ready");
      Object jsoVerfy=jso.getMember("appFx");
      if (null==jsoVerfy)log.warning("NULL JSObject appFx");
      ...
      here you get big NULL while run on 32bit JVM(1.8.0_121-b13).
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      JVM 64 base with 64bit windows, x86 CPU

            aroy Abhijit Roy (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: