kasemir / org.csstudio.display.builder

Update of org.csstudio.opibuilder.*
Eclipse Public License 1.0
2 stars 10 forks source link

Workspace Resource NullPointerException #553

Open dxmaxwell opened 4 years ago

dxmaxwell commented 4 years ago

When running the latest version of CS-Studio, I get the following exceptions:

2019-10-15 17:47:05.072 WARNING [Thread 37] org.csstudio.display.builder.model.persist.WidgetColorService (lambda$0) - Cannot load colors from /etc/cs-studio/color.def
java.lang.NullPointerException
        at org.csstudio.display.builder.model.util.WorkspaceResourceHelperImpl.openWorkspaceResource(WorkspaceResourceHelperImpl.java:92)
        at org.csstudio.display.builder.model.util.ModelResourceUtil.openResourceStream(ModelResourceUtil.java:434)
        at org.csstudio.display.builder.rcp.Plugin.lambda$0(Plugin.java:44)
        at org.csstudio.display.builder.model.persist.WidgetColorService.lambda$0(WidgetColorService.java:60)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

2019-10-15 17:47:05.074 WARNING [Thread 38] org.csstudio.display.builder.model.persist.WidgetFontService (lambda$0) - Cannot load fonts from /etc/cs-studio/font.def
java.lang.NullPointerException
        at org.csstudio.display.builder.model.util.WorkspaceResourceHelperImpl.openWorkspaceResource(WorkspaceResourceHelperImpl.java:92)
        at org.csstudio.display.builder.model.util.ModelResourceUtil.openResourceStream(ModelResourceUtil.java:434)
        at org.csstudio.display.builder.rcp.Plugin.lambda$1(Plugin.java:47)
        at org.csstudio.display.builder.model.persist.WidgetFontService.lambda$0(WidgetFontService.java:59)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

As you can see from the stacktrace, the exception is thrown here, which seems to rely on getRawLocationURI() to always return a value (instead of null).

But more problematic is that after c9b090fcbb171277af188d70e9706156937233a4, the method openWorkspaceResource() never returns null and as a result file system resources (outside the workspace) will not get loaded.

dxmaxwell commented 4 years ago

@kasemir - Is this the place to report issues with Display Builder, there seems to be a (partial) copy of this repository over in Phoebus?

kasemir commented 4 years ago

This is the display builder repo which was developed for the Eclipse/RCP based CS-Studio, using Java 8. Around May 2019, the Eclipse/RCP based CS-Studio was updated to use Java 9/10/11/12. This display builder repo has not been updated to use Java 9/10/11/12, i.e. it will not "work" with the current Eclipse-based CS-Studio. This is mostly because I for example have been unable to build a runnable version of the SNS product based on Eclipse/RCP since May. Got to the stage where it compiles, but won't run. So don't have a development setup that would allow me to make this repo compile and run with the Eclipse/RCP based CS-Studio under Java 9/10/11/12. The RCP build setup has simply gotten too complicated.

Meanwhile, the Phoebus repo contains most CS-Studio components, including the Display Builder, for Java 11/12. It builds within a few minutes via maven or ant or Eclipse or IntelliJ or .. Going forward, many sites that use the Display Builder thus concentrate on Phoebus:

kasemir commented 4 years ago

I've updated the Readme.md to reflect the current state

dxmaxwell commented 4 years ago

Not sure exactly how he did it, but Eric left me a CS Studio v4.6 product that runs on Java 11, and includes this version of Display Builder. The product also provides simple integration with Phoebus, which I think Kunal has developed. Thanks for the update.

kasemir commented 4 years ago

Yes, not sure. For this to compile and run with Java 11 and the JavaFX 11(or 12) that goes with it, some of the tweaks related to "Skins" as in #378 would be required. If you have the exact sources that were used to build, please diff against this repo and make pull requests.

Because of the Java FX changes and difficulties getting the JFX libs onto the Eclipse class path, Kunal's approach removes everything based on JavaFX from the Eclipse-based CS-Studio, and instead invokes the Phoebus counterpart via the transition plugins.