JDK-8253547 : Swing application stops without any jvm dumps or logs with JFXPanel and WebView
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: openjfx15
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2020-09-20
  • Updated: 2020-10-28
  • Resolved: 2020-09-23
Related Reports
Relates :  
Description
A DESCRIPTION OF THE PROBLEM :
OS: win 10 (64bit)

Simply created a swing application with JFXPanel and WebView.

Deployment: Classpath

Added all jar files (except ..swt.jar) to classpath and copied all dlls to the same directory in the classpath.

Showing a web page with WebView/WebEngine stops the application without any jvm dumps or logs...

If I try the same application with openJFX 11.0.2, no crash

tried with openJDK 12 (32, 64 bit), openJDK 14 (64 bit)
same problem

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Simply use WebView

ACTUAL -
crash

---------- BEGIN SOURCE ----------
public class WebPreview extends JFXPanel
{
	private WebEngine engine;

	private String sURL;

	public WebPreview()
	{
		Platform.setImplicitExit(false);
		Platform.runLater(new Runnable() 
		{
            @Override
            public void run() 
            {
                StackPane root = new StackPane();
                Scene scene = new Scene(root);
                
                WebView web = new WebView();
                
                engine = web.getEngine();

                root.getChildren().add(web);

                setScene(scene);
            }
       });
	}
	
	/**
	 * Sets the URL.
	 * 
	 * @param pURL the URL
	 */
	public void setURL(String pURL)
	{
		sURL = pURL;
		
		Platform.runLater(new Runnable() 
		{
            @Override
            public void run() 
            {
		        engine.load(sURL);
            }
		});
	}
	
	public String getURL()
	{
		return sURL;
	}
	
}

Use above class in a swing application and set the URL property. I set the URL via Thread:
e.g.

Thread th = new Thread(new Runnable() 
{
	@Override
	public void run() 
	{
		browser.load(sServer + "/screen/web/ui/?Application.language=en" +
				     "&Application.WelcomeScreen=" + sScreenName +
				     "&Application.responsive.mini.width=" + (ResponsiveUtil.getMaxWidth(visionx.getLauncher(), LayoutMode.Mini) - 125) + 
				     "&Application.responsive.small.width=" + (ResponsiveUtil.getMaxWidth(visionx.getLauncher(), LayoutMode.Small) - 125));
	}
});
th.start();

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

FREQUENCY : always



Comments
Duplicates to JDK-8221261
23-09-2020