JDK-8331640 : WebView, day to day used pages with maps are not working with most releases
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: jfx11,jfx20,jfx21,jfx22,jfx23
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2024-04-20
  • Updated: 2024-05-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
tbdUnresolved
Description
ADDITIONAL SYSTEM INFORMATION :
Mac / macOS Sonoma 14.3 / Does not work for Java 17, 22 and all inbetween. Probably also not for javafx 11.   

A DESCRIPTION OF THE PROBLEM :
Important pages containing maps are not working. Enter one of the following pages and see that there is nothing to see.

https://www.geoportal.ch/ch/map/40?y=2683332.00&x=1247089.90&scale=2000&rotation=0&topic=property&highlight=1&bfsnr=3203&property=W7391

https://www.openstreetmap.org/search?query=z%C3%BCrich&commit=Go#map=16/47.4078/9.3566&layers=H

https://www.google.ch/maps/@46.8358449,7.658535,9z?hl=de

REGRESSION : Last worked in version 18

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run provided Code with any of the three urls. 

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
See the maps. 
ACTUAL -
No map content is shown.

---------- BEGIN SOURCE ----------
package com.example.webviewsample;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class WebViewSample extends Application {

    @Override
    public void start(Stage primaryStage) {
        WebView webView = new WebView();
        WebEngine webEngine = webView.getEngine();

        TextField urlField = new TextField("https://www.openstreetmap.org/search?query=z%C3%BCrich&commit=Go#map=16/47.4078/9.3566&layers=H");
        //TextField urlField = new TextField("https://www.geoportal.ch/ch/map/40?y=2683332.00&x=1247089.90&scale=2000&rotation=0&topic=property&highlight=1&bfsnr=3203&property=W739");
        //TextField urlField = new TextField("https://www.google.ch/maps/@46.8358449,7.658535,9z?hl=de);

        Button goButton = new Button("Go");

        goButton.setOnAction(event -> {
            java.net.CookieHandler.setDefault(null);
            String url = urlField.getText();
            webEngine.load(url);
        });

        BorderPane root = new BorderPane();
        root.setTop(urlField);
        root.setCenter(webView);
        root.setBottom(goButton);

        Scene scene = new Scene(root, 800, 600);
        primaryStage.setScene(scene);
        primaryStage.setTitle("WebView Sample");
        primaryStage.show();
    }

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

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
No, not for all examples. For google maps, javafx 18 is said to be working, but its also not working for the other two urls.   

FREQUENCY : always



Comments
The issue is reproducible in all JFX versions above and including JFX 11. It is not reproducible with JDK8u411. I have tested it on Windows 11 x64 machine. Below are the observations: JDK 8u411: pass (screenshot is attached. Map is rendered) jfx11: fail jfx20: fail jfx21: fail jfx22: fail jfx23: fail Stacktrace when hitting the "Go" button: Exception in thread "JavaFX Application Thread" java.lang.ExceptionInInitializerError at javafx.web@23-ea/com.sun.webkit.network.NetworkContext.fwkLoad(NetworkContext.java:168) at javafx.web@23-ea/com.sun.webkit.WebPage.twkOpen(Native Method) at javafx.web@23-ea/com.sun.webkit.WebPage.open(WebPage.java:1298) at javafx.web@23-ea/javafx.scene.web.WebEngine.load(WebEngine.java:905) at JavaFXTest/application.WebViewSample.lambda$0(WebViewSample.java:31) at javafx.base@23-ea/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86) at javafx.base@23-ea/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232) at javafx.base@23-ea/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189) at javafx.base@23-ea/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at javafx.base@23-ea/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at javafx.base@23-ea/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@23-ea/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base@23-ea/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@23-ea/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base@23-ea/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@23-ea/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at javafx.base@23-ea/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49) at javafx.base@23-ea/javafx.event.Event.fireEvent(Event.java:199) at javafx.graphics@23-ea/javafx.scene.Node.fireEvent(Node.java:8917) at javafx.controls@23-ea/javafx.scene.control.Button.fire(Button.java:203) at javafx.controls@23-ea/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:207) at javafx.controls@23-ea/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274) at javafx.base@23-ea/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247) at javafx.base@23-ea/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) at javafx.base@23-ea/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232) at javafx.base@23-ea/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189) at javafx.base@23-ea/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at javafx.base@23-ea/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at javafx.base@23-ea/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@23-ea/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base@23-ea/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@23-ea/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base@23-ea/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@23-ea/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at javafx.base@23-ea/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.base@23-ea/javafx.event.Event.fireEvent(Event.java:199) at javafx.graphics@23-ea/javafx.scene.Scene$MouseHandler.process(Scene.java:3987) at javafx.graphics@23-ea/javafx.scene.Scene.processMouseEvent(Scene.java:1893) at javafx.graphics@23-ea/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2711) at javafx.graphics@23-ea/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411) at javafx.graphics@23-ea/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at javafx.graphics@23-ea/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450) at javafx.graphics@23-ea/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:430) at javafx.graphics@23-ea/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449) at javafx.graphics@23-ea/com.sun.glass.ui.View.handleMouseEvent(View.java:551) at javafx.graphics@23-ea/com.sun.glass.ui.View.notifyMouse(View.java:937) at javafx.graphics@23-ea/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics@23-ea/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.lang.NullPointerException at java.base/java.util.Objects.requireNonNull(Objects.java:233) at java.net.http/jdk.internal.net.http.HttpClientBuilderImpl.cookieHandler(HttpClientBuilderImpl.java:57) at java.net.http/jdk.internal.net.http.HttpClientBuilderImpl.cookieHandler(HttpClientBuilderImpl.java:40) at javafx.web@23-ea/com.sun.webkit.network.HTTP2Loader.lambda$static$0(HTTP2Loader.java:99) at java.base/java.security.AccessController.doPrivileged(AccessController.java:319) at javafx.web@23-ea/com.sun.webkit.network.HTTP2Loader.<clinit>(HTTP2Loader.java:95) ... 50 more
03-05-2024