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

JS2Java Bridge arrays and other parts of JS2Java Bridge do not work on Linux

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 7u6
    • Fix Version/s: 7u6
    • Component/s: javafx
    • Labels:
    • Environment:

      linux

    • Subcomponent:
      web

      Description

      JavaScript2Java Bridge arrays do not work on Linux.
      Try the following example to reproduce that:

      import com.sun.webpane.webkit.JSObject;
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.web.WebEngine;
      import javafx.scene.web.WebView;
      import javafx.stage.Stage;

      /**
       *
       * @author javafx
       */
      public class JavaFXApplication1 extends Application {

          /**
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              launch(args);
          }
          
          @Override
          public void start(Stage primaryStage) {
              WebView view = new WebView();
              WebEngine e = view.getEngine();
              int []array = new int[3];
              array[0] = 42;
              JSObject window = (JSObject) e.executeScript("window;");
              window.setMember("test", array);
              Object o1 = e.executeScript("test[0];");
              Object o2 = e.executeScript("test.length;");
              System.out.println(o1); // Expecting "42"
              System.out.println(o2); // Expecting "3"
              primaryStage.setScene(new Scene(view));
              primaryStage.show();
          }
      }

      The following output is generated:
      Exception in thread "JavaFX Application Thread" java.lang.NoSuchMethodError: booleanValue
      undefined
      undefined
      at com.sun.webpane.webkit.JSObject.setMemberImpl(Native Method)
      at com.sun.webpane.webkit.JSObject.setMember(JSObject.java:37)
      at javaapplication1.JavaFXApplication1.start(JavaFXApplication1.java:30)
      at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
      at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206)
      at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
      at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
      at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:82)
      at java.lang.Thread.run(Thread.java:722)

      Some other of our JS2Java tests which previously failed due to different reasons also fail with this exception, so the problem might be wider then JS2Java array.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                peterz Peter Zhelezniakov (Inactive)
                Reporter:
                ilatyshe Irina Grineva (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: