0

I'm trying to launch desktop java application on Debian.

Here is the details:

  • Debian Stretch 9.9
  • openjdk-8-jdk-headless:amd64 - 8u212-b01-1~deb9u1
  • openjfx - 8u141-b14-3~deb9u1

The application had been working ok for a long time on other PC previously. But on this machine, after starting my application I see empty window (no controls) and following exception:

java.lang.NullPointerException
    at com.sun.javafx.sg.prism.RegionImageCache.<init>(RegionImageCache.java:71)
    at com.sun.javafx.sg.prism.NGRegion.getImageCache(NGRegion.java:467)
    at com.sun.javafx.sg.prism.NGRegion.renderBackgroundRectangle(NGRegion.java:811)
    at com.sun.javafx.sg.prism.NGRegion.renderAsRectangle(NGRegion.java:751)
    at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:572)
    at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2053)
    at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1945)
    at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:235)
    at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:576)
    at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2053)
    at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1945)
    at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:235)
    at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:576)
    at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2053)
    at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1945)
    at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:477)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:330)
    at com.sun.javafx.tk.quantum.UploadingPainter.run(UploadingPainter.java:134)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:748)

Is there a way to workaround the issue ?

PS. Part of application code

Application.launch(FXMainWindow.class);

public class FXMainWindow extends Application  {

    private ArrayList<ToggleButton> components;

    @Override
    public void start(Stage stage) throws Exception {

        stage.setTitle("App");
        BorderPane root = new BorderPane();

        //bottom
        HBox bottom = new HBox();
        root.setBottom(bottom);

        Button btnRefreshAll = new Button("some");
        HBox.setHgrow(btnRefreshAll, Priority.ALWAYS);
        btnRefreshAll.setMaxWidth(Double.MAX_VALUE);
        btnRefreshAll.setOnAction(event-> {
                new EntityStateRefresher(actions, 10, this).start();
        });
        bottom.getChildren().add(btnRefreshAll);

         .....

        Scene scene = new Scene(root, 210, 363);
        stage.setScene(scene);
        stage.show();

    }
Eugene
  • 2,336
  • 21
  • 28
  • 1
    Whats the code causing the issue? – Matt May 13 '19 at 12:40
  • @Matt added code – Eugene May 13 '19 at 13:30
  • I guess, NPE caused by javafx renderer thread, not by application code. Also, I remind that application runs ok on oracle java/javafx – Eugene May 13 '19 at 13:43
  • 2
    This exception does not appear to be caused by anything you coded, but rather something is going wrong in the depths of JavaFX itself. Your version of OpenJDK 8 includes the word "_headless_", maybe that's the problem? – Slaw May 13 '19 at 13:46
  • Could it be similar to https://bugs.openjdk.java.net/browse/JDK-8191183? – Matt May 13 '19 at 13:55
  • Do you know what the JVM environment variables are set as? – Matt May 13 '19 at 13:56
  • @Slaw 'headless' actionally means that this jdk version doe not include appletviewer and jconsole – Eugene May 13 '19 at 15:06

1 Answers1

0

After installing video driver with OpenGL support (i915), and blacklisting nouveau, problem passed.

Thanks all for comments

Eugene
  • 2,336
  • 21
  • 28