Open BlueGoliath opened 3 years ago
Thank you for the bug report!
Can you share more details?
Which java version are you using?
Does your project set the property "glass.platform"
?
Can you reproduce this issue with one of the HelloWorld projects? Gradle: https://github.com/JPro-one/HelloJPro Maven: https://github.com/JPro-one/HelloJPro-Maven
Correction: this only happens when visible=true, sorry. When set to false, I can interact with the JavaFX application in the browser but when visible=true I cannot and get the above error. Yes, I can reproduce with the Maven example.
Again, sorry for the confusion.
OS is Arch Linux. I'm using Java 17(built from source) and JavaFX 16. I don't set glass.platform.
I understand why it only happens, when visible is false. Because otherwise this code-path isn't taken. The question is, why is glass.platform not set.
Do you do something, which can confuse these variables?
Can you test it with Java16? A Java17 nightly build obviously isn't supported, even though it should work in theory. It is directly build from this repository https://github.com/openjdk/jdk ? I guess it's at least uncommon to build the jdk yourself. Maybe you can try out a common JDK vendors, like AdoptOpenJDK.
I use source builds for Panama and cannot downgrade, sorry. The only JVM/App arguements are:
--add-opens=java.base/java.lang=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.file=ALL-UNNAMED --add-modules=jdk.incubator.foreign --enable-native-access=org.goliath.crosspoint,org.goliath.bindings.nvml,ALL-UNNAMED
I'm also using Gnome 40. Not sure if that matters or not.
With which command do you start the server? mvn jpro:run ? How are these JVM arguments set? JPro normally sets various JVM Arguments, which I can't see in your list.
Yes, via Netbeans. All arguments are set via the
You will have to use either the Maven or Gradle project, otherwise, it won't work. You can also set your JVMArgs with Maven and Gradle.
If Netbeans doesn't support starting the Maven/Gradle tasks, then you will have to start it from the terminal. From Intellij, you can directly start from the Maven/Gradle tasks, but I don't know whether that works for Netbeans.
Java17 ea builds will probably work, but I cannot guarantee.
probably the following JVM args are missing in your Setup: -Dglass.platform=Monocle -Dmonocle.platform=Headless -Dquantum.renderonlysnapshots=true How did you start JPro without these being set? Did you try to mirror the plugins? Or is your JVM for some reason ignoring the arguments we set?
I meant I run the jpro:run goal from the IDE via right clicking the project, hovering over "Run Maven" and then selecting the custom "jpro:run" goal. The POM section looks like:
`
<artifactId>jpro-maven-plugin</artifactId>
<version>2021.1.1</version>
<configuration>
<visible>true</visible>
<openURLOnStartup>true</openURLOnStartup>
<JVMArgs>
<JVMArg>--add-opens=java.base/java.lang=ALL-UNNAMED</JVMArg>
<JVMArg>--add-exports=java.base/sun.net.www.protocol.file=ALL-UNNAMED</JVMArg>
<JVMArg>--add-modules=jdk.incubator.foreign</JVMArg>
<JVMArg> --enable-native-access=org.goliath.crosspoint,org.goliath.bindings.nvml,ALL-UNNAMED</JVMArg>
<!-- <JVMArg>your-args</JVMArg> -->
</JVMArgs>
<mainClassName>org.goliath.envious.fx.app.GoliathEnviousFX</mainClassName>
<openingPath>/</openingPath>
</configuration>
</plugin>`
If I add all 3 of those JVM arguments then visible=true no longer shows the application. I'm guessing that's because of -Dmonocle.platform=Headless but when I remove that, I get:
java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: no glass_monocle in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:296)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:288)
at javafx.application.Platform.startup(Platform.java:111)
at simplefx.cores.interfaces.parts.testing.ApplicationStarter$.initialize(ApplicationStarter.scala:10)
at simplefx.cores.interfaces.parts.testing.CoreTesting$testing$.
This part in your configuration looks suspicious: <JVMArg> --enable-native-access=org.goliath.crosspoint,org.goliath.bindings.nvml,ALL-UNNAMED</JVMArg>
Be aware, that arguments can contain whitespace, in all OS the arguments to a command can contain whitespace, so there are ugly corner cases where people actually want whitespace and not argument separators. Maybe removing the whitespace at the beginning might help.
I would recommend you comparing your project with HelloJProMaven. Does the same issue happen there? Then I would gradually add your configurations in your current project to HelloJProMaven, and see, whether you can reproduce the same error.
The effect of the issue is, that the JVM is not configured to work with JPro. This causes:
Attempting to use the mouse in a web browser does not work(but does when visible=true via the app window). This error message is spammed in the output:
c.j.m.t.SceneInputListener - Error while processing the input: MouseEventToken(MouseEntered,265.0,639.0,MouseButtonToken(2),false,false,false,false,false,false,false,false) app: stage title: Goliath Envious FX V2 java.lang.NullPointerException: Cannot invoke "String.toLowerCase()" because the return value of "java.lang.System.getProperty(String)" is null at com.jpro.meta.tk.UtilSceneTKListener$.isMonocle$lzycompute(UtilSceneTKListener.scala:20) at com.jpro.meta.tk.UtilSceneTKListener$.isMonocle(UtilSceneTKListener.scala:20) at com.jpro.meta.tk.SceneInputListener.processInputInScene(SceneInputListener.scala:158) at com.jpro.meta.tk.SceneInputListener.processInput(SceneInputListener.scala:145) at com.jpro.meta.tk.SceneInputListener.processInputs(SceneInputListener.scala:108) at com.jpro.meta.tk.SceneInputListener.$anonfun$new$4(SceneInputListener.scala:42) at simplefx.cores.standard.parts.CoreTimeEvent.$anonfun$runAsAnimation$1(CoreTimeEvent.scala:64) at simplefx.cores.standard.parts.CoreTimeEvent$$anon$2.handle(CoreTimeEvent.scala:46) at javafx.animation.AnimationTimer$AnimationTimerReceiver.lambda$handle$0(AnimationTimer.java:57) at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)