JDK-8360270 : Websocket communication issues with Vaadin applications through webview
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: jfx24
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2025-06-19
  • Updated: 2025-09-08
  • Resolved: 2025-08-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx17.0.17Fixed
Related Reports
Relates :  
Description
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 ----------


Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx17u/pull/239 Date: 2025-09-06 08:21:53 +0000
06-09-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx21u/pull/102 Date: 2025-09-05 20:00:14 +0000
05-09-2025

[jfx25u-fix-request] Approval Request from Hima Bindu Meda This is a clean backport to jfx25u. This is needed in order to maintain same webkit code across all repos
13-08-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx25u/pull/5 Date: 2025-08-13 06:25:57 +0000
13-08-2025

Changeset: 4a8f3abc Branch: master Author: Hima Bindu Meda <hmeda@openjdk.org> Date: 2025-08-13 04:16:05 +0000 URL: https://git.openjdk.org/jfx/commit/4a8f3abc8ee665d1702df8d0bd63e9f663207ff1
13-08-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx/pull/1865 Date: 2025-08-06 17:51:44 +0000
07-08-2025

The issue is reproducible in JFX 24.0.1. Tested on Windows 11 x64 The issue is not reproducible on JFX 24 Steps to reproduce: Unzip the Vaadin source and run below commands > mvn clean package > mvn jetty:run-war Execute the attached javafx source
24-06-2025

ILW = MMM = P3 I = Vaadin @Push mode enabled stops working on upgrade L = can be reproduced as above. W = no workaround This is a regression also.
24-06-2025

Additional Information from submitter: ============================================ Simple vaadin application is most easily run as maven project. pom.xml: ```xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.fsaric</groupId> <artifactId>vaadin-push-demo</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <prerequisites> <maven>3</maven> </prerequisites> <properties> <vaadin.version>8.14.1</vaadin.version> <jetty.plugin.version>9.3.9.v20160517</jetty.plugin.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <vaadin.widgetset.mode>local</vaadin.widgetset.mode> <jetty.version>9.4.54.v20240208</jetty.version> </properties> <repositories> <repository> <id>vaadin-addons</id> <url>http://maven.vaadin.com/vaadin-addons</url> </repository> </repositories> <dependencyManagement> <dependencies> <dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-bom</artifactId> <version>${vaadin.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-server</artifactId> </dependency> <dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-push</artifactId> </dependency> <dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-client-compiled</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.2.0</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> <packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes> </configuration> </plugin> <plugin> <groupId>com.vaadin</groupId> <artifactId>vaadin-maven-plugin</artifactId> <version>${vaadin.version}</version> <executions> <execution> <goals> <goal>update-theme</goal> <goal>update-widgetset</goal> <goal>compile</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>${jetty.plugin.version}</version> <configuration> <httpConnector><port>8080</port></httpConnector> </configuration> </plugin> </plugins> </build> </project> ``` Entrypoint (put this in maven source root): ```java import javax.servlet.annotation.WebServlet; import com.vaadin.annotations.Push; import com.vaadin.annotations.VaadinServletConfiguration; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinServlet; import com.vaadin.ui.Button; import com.vaadin.ui.Label; import com.vaadin.ui.TextField; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; @Push // Enables web socket communication! public class ExampleUI extends UI { @Override protected void init(VaadinRequest vaadinRequest) { VerticalLayout layout = new VerticalLayout(); TextField name = new TextField("Type your name here:"); Button button = new Button("Click Me"); button.addClickListener(e -> layout.addComponent(new Label(String.format("Thanks %s, it works", name.getValue())))); layout.addComponents(name, button); setContent(layout); } @WebServlet(urlPatterns = "/*", name = "ExampleUIServlet") @VaadinServletConfiguration(productionMode = false, ui = ExampleUI.class) public static class MyUIServlet extends VaadinServlet { } } ``` the application can be run by first building it with `mvn clean package` and then running it with `mvn jetty:run-war`. It should be accessible on `localhost:8080` via browser, but it should fail to load (i.e. you should see session lost) on javafx 24.0.1 webview.
24-06-2025

Requested the submitter to provide raw source code of the vaadin example.
23-06-2025