user17022777
user17022777

Reputation:

WebView/WebEngine fails with GluonMobile, GraalVM22, JavaFX 17

I built a simple app using WebView/WebEngine using Gluon Mobile but the WebView fails with a unsatisfiedlink error. It works fine with gluonfx:run and so I then ran gluonfx:runagent to get all the reflection stuff etc. I then run gluonfx:build but the app fails on gluonfx:nativerun. I have a simple fxml starting with <View fx:id="web"...> (with controller being WebPresenter) and containing a containing a <VBox...> containing a <WebView fx:id="wv"...>. The code is:

public class WebPresenter {
    @FXML View      web;
    @FXML WebView   wv;
    
    public void initialize() {           
        WebEngine we = wv.getEngine();
        we.loadContent("<html><body><h1>WebEngine!</h1></body></html>");
    }
}

I run the build with NetBeans on Ubuntu 20.04 64bit, JavaFX v17.0.2, Charm v6.1.0, Java 17, graalvm-svm-java17-linux-gluon-22.0.0.3-Final. The reflect-json seems to have all the Web stuff necessary: com.sun.javafx.fxml.builder.web.WebViewBuilder, javafx.scene.web.WebView and WebPresenter.

The error occurs at load from the fxml <WebView...> and culminates in:

Caused by: java.lang.UnsatisfiedLinkError: com.sun.webkit.WebPage.twkInitWebCore(ZZZ)V [symbol: Java_com_sun_webkit_WebPage_twkInitWebCore or Java_com_sun_webkit_WebPage_twkInitWebCore__ZZZ]
:
at javafx.scene.web.WebView.<init>(WebView.java:275)
at com.sun.javafx.fxml.builder.web.WebViewBuilder.build(WebViewBuilder.java:66)

I had WebView/WebEngine working under slightly earlier versions (GraalVM11 and javafx-web 17.0.0.1). Am I missing something here?

Upvotes: 2

Views: 264

Answers (0)

Related Questions