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

Websocket communication issues with Vaadin applications through webview

XMLWordPrintable

    • web
    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      I've tested the issue with java 24, on macos aarch64, but we have first noticed the issue on windows machines.

      A DESCRIPTION OF THE PROBLEM :
      Opening Vaadin (I've tested specifically on version 8) application with `@Push` mode enabled stops working when upgrading from javafx version 24 to javafx version 24.0.1. Java used was openjdk 24 without bundled fx sdk.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Load Vaadin application (running in PUSH mode) from javafx webview on version 24.0.1.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Client applications to continue to work
      ACTUAL -
      Websocket session is lost. This is because underlying server (in my case jetty) can't read websocket frame. It complains about opcode being equal to 3, which according to websocket specification is reserved for future use, so likely the websocket frame is not correctly constructed.

      ---------- BEGIN SOURCE ----------
      Simple web view in fx:

      ```java
      public class HelloApplication extends Application {
          @Override
          public void start(Stage stage) {
              WebView myWebView = new WebView();
              Group myRoot = new Group();
              Scene myScene = new Scene(myRoot, 1000, 1000, Color.LIGHTGREY);
              myWebView.prefHeightProperty().bind(myScene.heightProperty());
              myWebView.prefWidthProperty().bind(myScene.widthProperty());
              myRoot.getChildren().add(myWebView);
              myWebView.getEngine().load("http://localhost:8080");
              stage.setScene(myScene);
              stage.show();
          }

          public static void main(String[] args) {
              launch();
          }
      }
      ```

      Vaadin application demo can be cloned from <github link>. One thing that needs to be change is @Push annotation needs to be added on `MyUI` class to enable Vaadin push mode (websocket communication).
      ---------- END SOURCE ----------

        1. Test.java
          0.8 kB
        2. JFX24.png
          JFX24.png
          20 kB
        3. JFX24.0.1.png
          JFX24.0.1.png
          43 kB
        4. vaadin8-example-master.zip
          24 kB

            jbhaskar Jay Bhaskar
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: