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

Native Compilation on Linux fails for a JavaFX app with deeply nested lambdas using a custom UI-DSL #3143

Closed
bgmf opened this issue Jan 21, 2021 · 8 comments
Assignees
Milestone

Comments

@bgmf
Copy link

bgmf commented Jan 21, 2021

Describe the issue

I've created a little JavaFX application, written in Kotlin with the purpose of running natively on Linux, or to be more precise on Ubuntu 20.04. The Kotlin part is a stripped down version from the UI-DSL build into TornadoFX (I only wanted part of the DSL, not the whole framework).

Because of that, there are very many lambdas. When you've nested enough lambdas, native-image will not be able to properly compile the code and always fail.
It looks the minimal Dialo-API (specifically the close function with a supplier), layout (vbox { ... }, etc.), as well as action listener seem to affected the most.

The only way to circumvent this is to reduce the lambda nesting, which results in differen code styles within one application only to mitigate the issue.

Steps to reproduce the issue

The issues only appear, when you've nested enough lambdas. Therefor I've created a gist that exactly showcases my issue.

  1. create an empty Maven project
  2. copy the pom.xml from the gist to your project
  3. properly place the source files (including the package names from the Kotlin files)
  4. place the resource files (all resource files have comment line describing where to put them)
    • remove the comment from the json file (reflectionconfig.json)
  5. you should now be able to build and run the application with the JVM of your choice
    • tested on GraalVM itself, AdoptOpenJDK & Full Liberica JDK
  6. $ export GRAALVM_HOME=/home/daniel/<path-to>/graalvm-ce/; export JAVA_HOME=$GRAALVM_HOME
  7. $ mvn clean client:build

Describe GraalVM and your environment:

  • GraalVM version: 20.3.0
  • JDK major version: 11
  • OS: Ubuntu 20.04
  • Architecture: AMD64
  • Memory: 32 GB
  • CPU: older Intel i7 with 4 cores and 8 threads

More details

On the aforementioned gist, there's a comment also describing everything in detail.

[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< eu.dzim:kotlin-javafx-graal >---------------------
[INFO] Building KotlinFX-Graal 0.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ kotlin-javafx-graal ---
[INFO] Deleting /home/daniel/git/github/graalfxtest/target
[INFO] 
[INFO] --------------------< eu.dzim:kotlin-javafx-graal >---------------------
[INFO] Building KotlinFX-Graal 0.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- client-maven-plugin:0.1.35:build (default-cli) @ kotlin-javafx-graal ---
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< eu.dzim:kotlin-javafx-graal >---------------------
[INFO] Building KotlinFX-Graal 0.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> client-maven-plugin:0.1.35:compile (default-cli) > process-classes @ kotlin-javafx-graal >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ kotlin-javafx-graal ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ kotlin-javafx-graal ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- kotlin-maven-plugin:1.4.21:compile (compile) @ kotlin-javafx-graal ---
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil (file:/home/daniel/.m2/repository/org/jetbrains/kotlin/kotlin-compiler/1.4.21/kotlin-compiler-1.4.21.jar) to method java.util.ResourceBundle.setParent(java.util.ResourceBundle)
WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
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
[WARNING] /home/daniel/git/github/graalfxtest/src/main/kotlin/eu/dzim/kfxg/fx/KotlinFX.kt: (91, 21) The expression is unused
[INFO] 
[INFO] <<< client-maven-plugin:0.1.35:compile (default-cli) < process-classes @ kotlin-javafx-graal <<<
[INFO] 
[INFO] 
[INFO] --- client-maven-plugin:0.1.35:compile (default-cli) @ kotlin-javafx-graal ---
[Do. Jan. 21 16:53:17 MEZ 2021][INFO] ==================== COMPILE TASK ====================
             _______  ___      __   __  _______  __    _
            |       ||   |    |  | |  ||       ||  |  | |
            |    ___||   |    |  | |  ||   _   ||   |_| |
            |   | __ |   |    |  |_|  ||  | |  ||       |
            |   ||  ||   |___ |       ||  |_|  ||  _    |
            |   |_| ||       ||       ||       || | |   |
            |_______||_______||_______||_______||_|  |__|

    Access to the latest docs, tips and tricks and more info on
    how to get support? Register your usage of Gluon Substrate now at

    https://gluonhq.com/activate



[Do. Jan. 21 16:53:18 MEZ 2021][INFO] We will now compile your code for x86_64-linux-linux. This may take some time.
[Do. Jan. 21 16:53:22 MEZ 2021][INFO] [SUB] [eu.dzim.kfxg.mainkt:107669]    classlist:   2,422.83 ms,  0.96 GB
[Do. Jan. 21 16:53:24 MEZ 2021][INFO] [SUB] [eu.dzim.kfxg.mainkt:107669]        (cap):     679.22 ms,  0.96 GB
[Do. Jan. 21 16:53:25 MEZ 2021][INFO] [SUB] [eu.dzim.kfxg.mainkt:107669]        setup:   2,434.34 ms,  0.96 GB
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB] [eu.dzim.kfxg.mainkt:107669]     analysis:  26,647.17 ms,  3.22 GB
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB] Fatal error:com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing eu.dzim.kfxg.App$start$3$1$1$1$7$1$1$$special$$inlined$apply$lambda$1.invoke(javafx.scene.layout.HBox) 
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB] Parsing context:
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     parsing eu.dzim.kfxg.App$start$3$1$1$1$7$1$1$$special$$inlined$apply$lambda$1.invoke(App.kt:22)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     parsing eu.dzim.kfxg.fx.KotlinFXKt.hbox(KotlinFX.kt:233)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     parsing eu.dzim.kfxg.fx.KotlinFXKt.hbox$default(KotlinFX.kt:48)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     parsing eu.dzim.kfxg.App.start(App.kt:78)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     parsing com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     parsing com.sun.javafx.application.LauncherImpl$$Lambda$587/0x00000007c1266c40.run(Unknown Source)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     parsing java.lang.Shutdown.runHooks(Shutdown.java:130)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     parsing java.lang.Shutdown.shutdown(Shutdown.java:186)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     parsing com.oracle.svm.core.jdk.RuntimeSupport.shutdown(RuntimeSupport.java:132)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     parsing com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:171)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     parsing com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:182)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     parsing com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB] 
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:138)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:327)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureParsed(MethodTypeFlow.java:302)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:103)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.DefaultAnalysisPolicy$DefaultSpecialInvokeTypeFlow.onObservedUpdate(DefaultAnalysisPolicy.java:368)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.TypeFlow.notifyObservers(TypeFlow.java:470)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:542)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.BigBang$2.run(BigBang.java:547)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB] Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: java.lang.NoClassDefFoundError: eu/dzim/kfxg/App$start$3$1$1$1$7$1$1$1$5
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at parsing eu.dzim.kfxg.App$start$3$1$1$1$7$1$1$$special$$inlined$apply$lambda$1.invoke(App.kt:120)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2566)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:96)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3404)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3206)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1092)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:986)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:70)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:212)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:223)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:357)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:313)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     ... 13 more
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB] Caused by: java.lang.NoClassDefFoundError: eu/dzim/kfxg/App$start$3$1$1$1$7$1$1$1$5
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at java.base/java.lang.Class.getEnclosingMethod0(Native Method)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at java.base/java.lang.Class.hasEnclosingMethodInfo(Class.java:1708)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at java.base/java.lang.Class.isLocalOrAnonymousClass(Class.java:1704)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at java.base/java.lang.Class.isLocalClass(Class.java:1656)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJDKReflection.isLocalClass(HotSpotJDKReflection.java:94)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotResolvedObjectTypeImpl.isLocal(HotSpotResolvedObjectTypeImpl.java:967)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.meta.AnalysisType.isLocal(AnalysisType.java:1021)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.svm.hosted.SVMHost.createHub(SVMHost.java:379)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.svm.hosted.SVMHost.registerType(SVMHost.java:249)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.meta.AnalysisUniverse.createType(AnalysisUniverse.java:272)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:210)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:187)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.infrastructure.AnalysisConstantPool.lookupField(AnalysisConstantPool.java:48)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.lookupField(BytecodeParser.java:4314)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genGetStatic(BytecodeParser.java:4868)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5354)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3399)
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB]     ... 25 more
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] [SUB] Error: Image build request failed with exit status 1
[Do. Jan. 21 16:53:52 MEZ 2021][SEVERE] Process compile failed with result: 1
Check the log files under /home/daniel/git/github/graalfxtest/target/client/x86_64-linux/gvm/log
And please check https://docs.gluonhq.com/client/ for more information.
[Do. Jan. 21 16:53:52 MEZ 2021][INFO] Logging process [compile] to file: /home/daniel/git/github/graalfxtest/target/client/log/process-compile-1611244432307.log
[Do. Jan. 21 16:53:52 MEZ 2021][SEVERE] Compiling failed.
Check the log files under /home/daniel/git/github/graalfxtest/target/client/x86_64-linux/gvm/log
And please check https://docs.gluonhq.com/client/ for more information.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 48.467 s
[INFO] Finished at: 2021-01-21T16:53:52+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gluonhq:client-maven-plugin:0.1.35:compile (default-cli) on project kotlin-javafx-graal: Compiling failed -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 50.604 s
[INFO] Finished at: 2021-01-21T16:53:52+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gluonhq:client-maven-plugin:0.1.35:build (default-cli) on project kotlin-javafx-graal: Error, client:build failed -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

The build mentioned other logs. In fact there are two of them, which basically contain the same information about the crash as this log here. You can find one of the logs in the gist's comment.

@munishchouhan
Copy link
Contributor

@bgmf We have released GraalVM 21.0
Please try it and let us know

@bgmf
Copy link
Author

bgmf commented Jan 25, 2021

$> echo $GRAALVM_HOME; echo $JAVA_HOME
/home/daniel/programs/java/graalvm/graalvm-ce/
/home/daniel/programs/java/graalvm/graalvm-ce/ 

Where /home/daniel/programs/java/graalvm/graalvm-ce/ points to

$> /home/daniel/programs/java/graalvm/graalvm-ce/bin/java --version
openjdk 11.0.10 2021-01-19
OpenJDK Runtime Environment GraalVM CE 21.0.0 (build 11.0.10+8-jvmci-21.0-b06)
OpenJDK 64-Bit Server VM GraalVM CE 21.0.0 (build 11.0.10+8-jvmci-21.0-b06, mixed mode, sharing)

$> /home/daniel/programs/java/graalvm/graalvm-ce/bin/native-image --version
GraalVM Version 21.0.0 (Java Version 11.0.10+8-jvmci-21.0-b06)

Unfortunately it fails with the same error:

mvn clean client:build
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< eu.dzim:kotlin-javafx-graal >---------------------
[INFO] Building KotlinFX-Graal 0.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ kotlin-javafx-graal ---
[INFO] Deleting /home/daniel/git/github/graalfxtest/target
[INFO] 
[INFO] --------------------< eu.dzim:kotlin-javafx-graal >---------------------
[INFO] Building KotlinFX-Graal 0.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- client-maven-plugin:0.1.35:build (default-cli) @ kotlin-javafx-graal ---
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< eu.dzim:kotlin-javafx-graal >---------------------
[INFO] Building KotlinFX-Graal 0.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> client-maven-plugin:0.1.35:compile (default-cli) > process-classes @ kotlin-javafx-graal >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ kotlin-javafx-graal ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ kotlin-javafx-graal ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- kotlin-maven-plugin:1.4.21:compile (compile) @ kotlin-javafx-graal ---
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil (file:/home/daniel/.m2/repository/org/jetbrains/kotlin/kotlin-compiler/1.4.21/kotlin-compiler-1.4.21.jar) to method java.util.ResourceBundle.setParent(java.util.ResourceBundle)
WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
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
[WARNING] /home/daniel/git/github/graalfxtest/src/main/kotlin/eu/dzim/kfxg/fx/KotlinFX.kt: (91, 21) The expression is unused
[INFO] 
[INFO] <<< client-maven-plugin:0.1.35:compile (default-cli) < process-classes @ kotlin-javafx-graal <<<
[INFO] 
[INFO] 
[INFO] --- client-maven-plugin:0.1.35:compile (default-cli) @ kotlin-javafx-graal ---
[Mo. Jan. 25 15:38:25 MEZ 2021][INFO] ==================== COMPILE TASK ====================
             _______  ___      __   __  _______  __    _
            |       ||   |    |  | |  ||       ||  |  | |
            |    ___||   |    |  | |  ||   _   ||   |_| |
            |   | __ |   |    |  |_|  ||  | |  ||       |
            |   ||  ||   |___ |       ||  |_|  ||  _    |
            |   |_| ||       ||       ||       || | |   |
            |_______||_______||_______||_______||_|  |__|

    Access to the latest docs, tips and tricks and more info on
    how to get support? Register your usage of Gluon Substrate now at

    https://gluonhq.com/activate



[Mo. Jan. 25 15:38:26 MEZ 2021][INFO] We will now compile your code for x86_64-linux-linux. This may take some time.
[Mo. Jan. 25 15:38:30 MEZ 2021][INFO] [SUB] [eu.dzim.kfxg.mainkt:72756]    classlist:   2,338.13 ms,  0.96 GB
[Mo. Jan. 25 15:38:32 MEZ 2021][INFO] [SUB] [eu.dzim.kfxg.mainkt:72756]        (cap):     699.36 ms,  0.94 GB
[Mo. Jan. 25 15:38:33 MEZ 2021][INFO] [SUB] [eu.dzim.kfxg.mainkt:72756]        setup:   2,625.19 ms,  0.94 GB
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB] [eu.dzim.kfxg.mainkt:72756]     analysis:  25,853.61 ms,  2.68 GB
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB] Fatal error:com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing eu.dzim.kfxg.App$start$3$1$1$1$7$1$1$$special$$inlined$apply$lambda$1.invoke(javafx.scene.layout.HBox) 
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB] Parsing context:
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     parsing eu.dzim.kfxg.App$start$3$1$1$1$7$1$1$$special$$inlined$apply$lambda$1.invoke(App.kt:22)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     parsing eu.dzim.kfxg.fx.KotlinFXKt.hbox(KotlinFX.kt:233)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     parsing eu.dzim.kfxg.fx.KotlinFXKt.hbox$default(KotlinFX.kt:48)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     parsing eu.dzim.kfxg.App.start(App.kt:78)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     parsing com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     parsing com.sun.javafx.application.LauncherImpl$$Lambda$628/0x00000007c134ec40.run(Unknown Source)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     parsing java.lang.Shutdown.runHooks(Shutdown.java:130)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     parsing java.lang.Shutdown.shutdown(Shutdown.java:186)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     parsing com.oracle.svm.core.jdk.RuntimeSupport.shutdown(RuntimeSupport.java:132)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     parsing com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:171)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     parsing com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:182)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     parsing com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB] 
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:138)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:327)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureParsed(MethodTypeFlow.java:302)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:103)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.DefaultAnalysisPolicy$DefaultSpecialInvokeTypeFlow.onObservedUpdate(DefaultAnalysisPolicy.java:368)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.TypeFlow.notifyObservers(TypeFlow.java:470)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:542)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.BigBang$2.run(BigBang.java:547)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB] Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: java.lang.NoClassDefFoundError: eu/dzim/kfxg/App$start$3$1$1$1$7$1$1$1$5
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at parsing eu.dzim.kfxg.App$start$3$1$1$1$7$1$1$$special$$inlined$apply$lambda$1.invoke(App.kt:120)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2586)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:106)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3441)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3243)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1109)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1003)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:76)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:212)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:223)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:357)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:313)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     ... 13 more
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB] Caused by: java.lang.NoClassDefFoundError: eu/dzim/kfxg/App$start$3$1$1$1$7$1$1$1$5
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at java.base/java.lang.Class.getEnclosingMethod0(Native Method)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at java.base/java.lang.Class.hasEnclosingMethodInfo(Class.java:1708)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at java.base/java.lang.Class.isLocalOrAnonymousClass(Class.java:1704)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at java.base/java.lang.Class.isLocalClass(Class.java:1656)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJDKReflection.isLocalClass(HotSpotJDKReflection.java:94)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotResolvedObjectTypeImpl.isLocal(HotSpotResolvedObjectTypeImpl.java:967)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.meta.AnalysisType.isLocal(AnalysisType.java:1023)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.svm.hosted.SVMHost.createHub(SVMHost.java:379)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.svm.hosted.SVMHost.registerType(SVMHost.java:249)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.meta.AnalysisUniverse.createType(AnalysisUniverse.java:272)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:210)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:187)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at com.oracle.graal.pointsto.infrastructure.AnalysisConstantPool.lookupField(AnalysisConstantPool.java:48)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.lookupField(BytecodeParser.java:4360)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genGetStatic(BytecodeParser.java:4914)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5400)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3436)
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB]     ... 25 more
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] [SUB] Error: Image build request failed with exit status 1
[Mo. Jan. 25 15:38:59 MEZ 2021][SEVERE] Process compile failed with result: 1
Check the log files under /home/daniel/git/github/graalfxtest/target/client/x86_64-linux/gvm/log
And please check https://docs.gluonhq.com/client/ for more information.
[Mo. Jan. 25 15:38:59 MEZ 2021][INFO] Logging process [compile] to file: /home/daniel/git/github/graalfxtest/target/client/log/process-compile-1611585539414.log
[Mo. Jan. 25 15:38:59 MEZ 2021][SEVERE] Compiling failed.
Check the log files under /home/daniel/git/github/graalfxtest/target/client/x86_64-linux/gvm/log
And please check https://docs.gluonhq.com/client/ for more information.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 50.087 s
[INFO] Finished at: 2021-01-25T15:38:59+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gluonhq:client-maven-plugin:0.1.35:compile (default-cli) on project kotlin-javafx-graal: Compiling failed -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 52.171 s
[INFO] Finished at: 2021-01-25T15:38:59+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gluonhq:client-maven-plugin:0.1.35:build (default-cli) on project kotlin-javafx-graal: Error, client:build failed -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@bgmf
Copy link
Author

bgmf commented Feb 5, 2021

Are there any news on this issue? Could you recreate it with the provided code?

@munishchouhan
Copy link
Contributor

@bgmf I have raised a bug for this to dev team
We will update you soon with the fix

@bgmf
Copy link
Author

bgmf commented Apr 6, 2021

@christianwimmer are there any news on this issue?

@cstancu
Copy link
Member

cstancu commented Apr 17, 2021

Fixed by 075fcde. You'll need to use --allow-incomplete-classpath.

@cstancu cstancu closed this as completed Apr 17, 2021
@cstancu cstancu added this to the 21.2 milestone Apr 17, 2021
@bgmf
Copy link
Author

bgmf commented Apr 19, 2021

Thank you very much!
I'll add the --allow-incomplete-classpath parameter to our build script in the mean time.

@bgmf
Copy link
Author

bgmf commented May 7, 2021

Just as a follow up notice: When using a custom GraalVM build from GluonHQ (based on v21.1.x) in combination with Kotlin 1.5.0 (which is switching to use invokedynamic instead of heavily relying on anonymous classes), seems to also help with building the app.

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

No branches or pull requests

4 participants