Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

monocle 21 jpms #107

Open
tg-freigmbh opened this issue Mar 1, 2024 · 1 comment
Open

monocle 21 jpms #107

tg-freigmbh opened this issue Mar 1, 2024 · 1 comment

Comments

@tg-freigmbh
Copy link

I am using fx + monocle version 21.0.2
I put the libraries on the module path and use --add-modules=ALL-MODULE-PATH

I get an exception because monocle uses internal classes from javafx. Is this the expected behaviour and I should figure out the needed --add-exports myself? Its a bit odd that the documentation doesnt mention anything about this

Best regards,
Thorsten Goetzke
{code}
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.RuntimeException: java.lang.IllegalAccessError: superclass access check failed: class com.sun.glass.ui.monocle.MonoclePlatformFactory (in module org.testfx.monocle) cannot access class com.sun.glass.ui.PlatformFactory (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.ui to module org.testfx.monocle [in thread "main"]^M
at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:300)^M
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:292)^M
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:162)^M
at [email protected]/javafx.embed.swing.JFXPanel.initFx(JFXPanel.java:247)^M
at [email protected]/javafx.embed.swing.JFXPanel.(JFXPanel.java:263)^M
at securiton.uls.utilities.lang.javafx.PlatformUtil.initJavaFx(PlatformUtil.java:38)^M
at securiton.uls.tools.configuration.launcher.IntTestApplicationImpl.(IntTestApplicationImpl.java:157)^M
... 105 more^M
{code}

@mvsoder
Copy link
Collaborator

mvsoder commented Mar 1, 2024

Yes, unfortunately TestFX and the Monocle builds for TestFX need access to some protected classes and those need to be opened from the command line. As you have also discovered, this is not well documented. However, since I'm also using TestFX 21 and Monocle 21, here are the commands you need to add:

--add-opens=javafx.base/com.sun.javafx.logging=ALL-UNNAMED 
--add-opens=javafx.graphics/com.sun.glass.ui=ALL-UNNAMED 
--add-opens=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED 
--add-opens=javafx.graphics/com.sun.javafx.util=ALL-UNNAMED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants