Custom JavaFX webview plugin [help] #595
Replies: 3 comments 1 reply
-
@nroduit |
Beta Was this translation helpful? Give feedback.
-
JavaFX was evaluated but not chosen several years ago, as there were significant performance problems on canvas for 2D rendering on images. Using JavaFX properly requires quite a bit of transformation in the launcher and OSGI configuration. Unfortunately, I can only advise you not to use JavaFX. |
Beta Was this translation helpful? Give feedback.
-
I've had a quick look at the project and I think that unfortunately it hasn't been designed to handle different classloaders as in OSGI. In fact, OSGI already does this job more cleanly and in Weasis you can see that packaging is relatively simple for JOGL (also used in jcef). You just need to find the right configuration for the main bundle with the import/export packages, and the native packages are bundle fragments that load automatically by OSGI. Perhaps a simpler alternative for managing an independent third-party application is to use launchers to transmit patient/exam information to a third-party application. |
Beta Was this translation helpful? Give feedback.
-
Hi Devs,
I am new to Weasis and OSGI framework. i am trying to build a custom dockable plugin to integrate a simple WebView for reporting purposes. I have added the necessary JavaFX dependencies (e.g., javafx-base, javafx-web, javafx-swing, etc.) and included all the imports in the base.json file under extra imports. However, I am encountering a ClassNotFoundError at runtime when trying to call any methods of classes that contain JavaFX-related imports.
Error logs:
30.09.2024 20:28:07.172 INFO [AWT-EventQueue-0] org.weasis.dicom.explorer.LoadDicom: End of loading DICOM locally
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javafx/beans/value/ObservableValue
at org.weasis.dicom.viewer2d.dockable.DisplayTool.lambda$iniTree$3(DisplayTool.java:159)
...
Caused by: java.lang.ClassNotFoundException: javafx.beans.value.ObservableValue
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
...
Here’s what I added to the base.json under the extra dependencies section:
base.json extra plugins.
{
"code": "org.osgi.framework.system.packages.extra",
"value": "${framework.system.packages.extra.basic}, javafx.animation, javafx.beans, javafx.beans.value, javafx.scene, javafx.embed.swing, javafx.scene.web, javafx.beans, javafx.beans.value ...",
"description": "List of additional packages for OSGI framework (by default only java.* is visible in main class loader)",
"type": "A",
"category": "FELIX_CONFIG"
}
Has anyone encountered a similar issue or knows how to resolve this ClassNotFoundError or there any way i can integrate a webview plugin. ? Any help would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions