JPro-one / JPro-Tickets

The right place to report about bugs or suggest improvements for JPro.
https://www.jpro.one
9 stars 4 forks source link

More on Monocle #35

Open ishopservice opened 4 years ago

ishopservice commented 4 years ago

Hello Florian,

Recently, I lifted my application from Java8 to Java11. Now, in javaFX, it runs just fine. In Jpro, I get the error stack below:

Here: https://github.com/JPro-one/HelloJPro/issues/5 you claim that the Monocle problem has been solved in version 2018.1.14

questions: 1) What can I do to avoid this problem? 2) If Monocle is a font, which I am not even sure of because the term is used for many things, can I avoid this problem by assigning a font value to every label etc. in the application? Right now, I do not assign any font

on this page: https://github.com/JPro-one/JPro-tickets/issues/4 you state: "This only happens, when monocle is used."

3) My question is: Is it possible not to use monocle? How do I achieve that?

A similar problem is described here: https://stackoverflow.com/questions/29116819/javafx-maven-testfx-monocle-dont-work-together/29131967#29131967

I built monocle.jar myself and added it to my project. No success.

Kind regards,

Jan van der Meer iShopService


jvdm@blackbox:~$ java -version openjdk version "11.0.4" 2019-07-16 OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu219.04) OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu219.04, mixed mode, sharing) jvdm@blackbox:~$ javac -version javac 11.0.4 jvdm@blackbox:~$

Task :solar-client:jproRun

WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/home/jvdm/.m2/repository/com/google/inject/guice/4.1.0/guice-4.1.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [info] a.e.s.Slf4jLogger - Slf4jLogger started [info] c.jpro.activity - Starting the server [info] c.j.i.s.Initializer$ - Starting JPro: https://www.jpro.one/ [info] c.j.i.s.Initializer$ - OS: Linux [info] c.j.i.s.Initializer$ - JPro: 2019.1.3 [info] c.j.i.s.Initializer$ - Java version: 11.0.4 [info] c.j.i.s.Initializer$ - JVM: 11.0.4 Ubuntu [info] c.j.i.s.Initializer$ - redirected OUT / ERR [info] c.j.i.s.Initializer$ - installed SLF4JBridge [error] c.j.i.s.Initializer$ - error while applying configuration inject monocle: java.lang.ExceptionInInitializerError: null at com.jpro.internal.server.Initializer$.$anonfun$new$7(Initializer.scala:137) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at com.jpro.internal.server.Initializer$.execute(Initializer.scala:46) at com.jpro.internal.server.Initializer$.(Initializer.scala:137) at com.jpro.internal.server.Initializer$.(Initializer.scala) at controllers.jpro.(jpro.scala:44) at controllers.jpro$$FastClassByGuice$$3baba93a.newInstance() at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89) at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111) at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90) Caused by: java.lang.ClassNotFoundException: com.sun.glass.ui.monocle.MonoclePlatformFactory at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at simplefx.util.ReflectionUtil.loadClass(ReflectionUtil.scala:38) at simplefx.util.ReflectionUtil.callNew(ReflectionUtil.scala:103) at com.jpro.internal.server.MonocleInitializer$.inst$lzycompute$1(MonocleInitializer.scala:21) at com.jpro.internal.server.MonocleInitializer$.inst$1(MonocleInitializer.scala:21) at com.jpro.internal.server.MonocleInitializer$.$anonfun$new$1(MonocleInitializer.scala:22) at com.jpro.internal.server.MonocleInitializer$.setIfNull(MonocleInitializer.scala:17) at com.jpro.internal.server.MonocleInitializer$.(MonocleInitializer.scala:22) Warning: Quantum will not submit render jobs, nothing should draw java.lang.ClassNotFoundException: com.sun.glass.ui.monocle.MonoclePlatformFactory at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:315) at com.sun.glass.ui.PlatformFactory.getPlatformFactory(PlatformFactory.java:42) at com.sun.glass.ui.Application.run(Application.java:144) at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:279) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158) at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:834) Failed to load Glass factory class Got error while javafx.application.Application.launch java.lang.NullPointerException at com.sun.glass.ui.Application.run(Application.java:144) at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:279) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158) at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:834) Initialization didn't finished after 5 seconds: reduce javafx keybindings


buildscript { repositories { jcenter()

    maven {
        url "http://sandec.bintray.com/repo"
    }
}

dependencies {
    classpath 'com.sandec.jpro:jpro-plugin-gradle:2019.1.3'
}

} plugins { id 'org.openjfx.javafxplugin' version '0.0.8' } apply plugin: 'maven'

javafx { version = "11.0.2" modules = [ 'javafx.controls', 'javafx.base', 'javafx.fxml', 'javafx.graphics', 'javafx.web' ] }

description = 'solar-client'

dependencies { compile project(':solar-common') compile(group: 'org.springframework', name: 'spring-context', version: "${springframeworkVersion}") { exclude(module: 'commons-logging') } compile group: 'org.springframework', name: 'spring-web', version: "${springframeworkVersion}" compile group: 'cglib', name: 'cglib', version: "${cglibVersion}" compile group: 'javax.inject', name: 'javax.inject', version:"${injectVersion}" compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${fasterxmlVersion}" compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${fasterxmlVersion}" compile group: 'org.slf4j', name: 'slf4j-api', version: "${slf4jVersion}" compile group: 'org.slf4j', name: 'jcl-over-slf4j', version:"${slf4jVersion}" compile group: 'org.slf4j', name: 'slf4j-log4j12', version:"${slf4jVersion}" compile group: 'log4j', name: 'log4j', version:"${log4jVersion}" compile group: 'org.yaml', name: 'snakeyaml', version: "${snakeyamlVersion}" compile group: 'junit', name: 'junit', version:"${junitVersion}" compile group: 'javax.xml.bind', name: 'jaxb-api', version: "${jaxbapiVersion}" compile group: 'org.openjfx', name: 'javafx-base', version: "${javafxVersion}" compile group: 'org.openjfx', name: 'javafx-fxml', version: "${javafxVersion}" compile group: 'org.openjfx', name: 'javafx-web', version: "${javafxVersion}" compile group: 'org.openjfx', name: 'javafx-graphics', version: "${javafxVersion}" compile group: 'org.openjfx', name: 'javafx-controls', version: "${javafxVersion}"

}

apply plugin: 'com.sandec.jpro' mainClassName = 'nl.ishopservice.solar.client.SolarApplication'

jpro { // for debugging // JVMArgs << '-agentlib:jdwp=transport=dt_socket,server=n,address=5006,suspend=y'

JVMArgs << '-Xmx4096m'
JVMArgs <<'-Dspring.profiles.active=dev'

//jpro server port
port = 8090

//jpro version (optional)
jproVersion = "2019.1.3"

openingPath = ""

}

FlorianKirmaier commented 4 years ago

Hello,

first of all, this should no longer happen so this is a new problem.

monocle is added and installed by JPro automatically. JPro automatically adds the correct version required for the provided java version.

When you add monocle by your self, this might interfere with JPro adding the correct version. You should remove monocle from your dependencies (except for unit-tests)

To answer your questions: 1) Give us a minified reproducible sample/project. This way you will either find the cause for the problem, or we will be in the situation to easily fix the problem.

2) Monocle is not a font. But monocle has some influence on how fonts are found. 3) JPro can't run without monocle in production. You can set visible to true, then JPro runs without monocle, but this is only useful to detect rendering problems.

Do you also get this problem on windows or mac?

Florian

ishopservice commented 4 years ago

It also fails in windows

Gradle Daemon started in 2 s 350 ms

Task :solar-common:compileJava UP-TO-DATE Task :solar-common:processResources UP-TO-DATE Task :solar-common:classes UP-TO-DATE Task :solar-common:jar UP-TO-DATE Task :solar-client:compileJava UP-TO-DATE Task :solar-client:processResources UP-TO-DATE Task :solar-client:classes UP-TO-DATE Task :solar-client:prepareBrowser

Task :solar-client:jproRun C:\Users\jvdm.gradle\daemon\5.1.1\RUNNING_PID already exists. Process with pid: 6974 is terminated. A new process is getting created.

WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/C:/Users/jvdm/.gradle/caches/modules-2/files-2.1/com.google.inject/guice/4.1.0/eeb69005da379a10071aa4948c48d89250febb07/guice-4.1.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [info] a.e.s.Slf4jLogger - Slf4jLogger started [info] c.jpro.activity - Starting the server [info] c.j.i.s.Initializer$ - Starting JPro: https://www.jpro.one/ [info] c.j.i.s.Initializer$ - OS: Windows 7 [info] c.j.i.s.Initializer$ - JPro: 2019.1.3 [info] c.j.i.s.Initializer$ - Java version: 11 [info] c.j.i.s.Initializer$ - JVM: 11 Oracle Corporation [info] c.j.i.s.Initializer$ - redirected OUT / ERR [info] c.j.i.s.Initializer$ - installed SLF4JBridge [error] c.j.i.s.Initializer$ - error while applying configuration inject monocle: java.lang.ExceptionInInitializerError: null at com.jpro.internal.server.Initializer$.$anonfun$new$7(Initializer.scala:137) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at com.jpro.internal.server.Initializer$.execute(Initializer.scala:46) at com.jpro.internal.server.Initializer$.(Initializer.scala:137) at com.jpro.internal.server.Initializer$.(Initializer.scala) at controllers.jpro.(jpro.scala:44) at controllers.jpro$$FastClassByGuice$$3baba93a.newInstance() at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89) at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111) at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90) Caused by: java.lang.ClassNotFoundException: com.sun.glass.ui.monocle.MonoclePlatformFactory at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at simplefx.util.ReflectionUtil.loadClass(ReflectionUtil.scala:38) at simplefx.util.ReflectionUtil.callNew(ReflectionUtil.scala:103) at com.jpro.internal.server.MonocleInitializer$.inst$lzycompute$1(MonocleInitializer.scala:21) at com.jpro.internal.server.MonocleInitializer$.inst$1(MonocleInitializer.scala:21) at com.jpro.internal.server.MonocleInitializer$.$anonfun$new$1(MonocleInitializer.scala:22) at com.jpro.internal.server.MonocleInitializer$.setIfNull(MonocleInitializer.scala:17) at com.jpro.internal.server.MonocleInitializer$.(MonocleInitializer.scala:22) Warning: Quantum will not submit render jobs, nothing should draw java.lang.ClassNotFoundException: com.sun.glass.ui.monocle.MonoclePlatformFactory at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:315) at com.sun.glass.ui.PlatformFactory.getPlatformFactory(PlatformFactory.java:42) at com.sun.glass.ui.Application.run(Application.java:144) at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:279) Failed to load Glass factory class at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158) at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:834) Got error while javafx.application.Application.launch java.lang.NullPointerException at com.sun.glass.ui.Application.run(Application.java:144) at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:279) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158) at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:834) Initialization didn't finished after 5 seconds: reduce javafx keybindings

FlorianKirmaier commented 4 years ago

The error happens before any of your code is run. Sadly, I cannot reproduce the problem. To help you, I would need your help. Can you try to make a as simple as possible project, which creates the same error? There must be somewhere a difference between your project and our HelloJPro, which causes your error. Ideally, you would make a new GitHub project for it, our you can send it to us as a zip by email Then we could provide a solution for the problem, and you can probably also workaround it.

ishopservice commented 4 years ago

The problem disappeared after I changed the line:

compile group: 'org.openjfx', name: 'javafx-base', version: "${javafxVersion}"

in build.gradle into:

compile "org.openjfx:javafx-base:$javafxVersion:$platform"

So, basically I added the platform. In my case, the value of $platform is "linux"

jasons2000 commented 4 years ago

I used monocle in my testing and scope was limited to "test" in my pom. For version "2019.1.0" I would get a similar error. Removing the limited test "scope" fixed the problem.

However, upgrading to "2019.1.3" removed the problem all together, and I have now returned my own monocle dependency back to the scope of test.