question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

client:compile fails with "Error parsing reflection configuration"

See original GitHub issue

Hi Gluon-Team

I tried to compile a simple test application (which contains Kotlin, JavaFX base, controls & graphic). I can compile and run it with the javafx:run goal, but client:compile fails with the following message:

daniel@ghua-xps15:~/git/other/packagetest$ GRAALVM_HOME=/home/daniel/programs/java/graalvm/graalvm-ce; JAVA_HOME=/home/daniel/programs/java/graalvm/graalvm-ce ./mvnw client:compile
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------< ch.cnlab.jfx.test:package-test >-------------------
[INFO] Building package-test 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- client-maven-plugin:0.1.11:compile (default-cli) @ package-test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/daniel/git/other/packagetest/src/main/resources
[INFO] Nothing to compile - all classes are up to date
We will now compile your code for x86_64-linux-linux. This may take some time.
Build on Server(pid: 13044, port: 34253)
[ch.cnlab.jfx.test.appkt:13044]    classlist:   3,199.41 ms
[ch.cnlab.jfx.test.appkt:13044]        (cap):     544.55 ms
[ch.cnlab.jfx.test.appkt:13044]        setup:     636.88 ms
Error: Error parsing reflection configuration in /home/daniel/git/other/packagetest/target/client/x86_64-linux/gvm/reflectionconfig-x86_64-linux.json:
Method com.sun.javafx.logging.PrintLogger.createInstance() not found. To allow unresolvable reflection configuration, use option -H:+AllowIncompleteClasspath
Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option ReflectionConfigurationFiles.
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1
Compilation failed with result = 1
Compilation failed. See error printed above.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.540 s
[INFO] Finished at: 2020-01-15T16:19:50+01:00
[INFO] ------------------------------------------------------------------------

Here’s my pom.xml:

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>ch.cnlab.jfx.test</groupId>
    <artifactId>package-test</artifactId>
    <version>0.0.1</version>

    <name>package-test</name>
    <description>JavaFX application to test packaging with.</description>

    <url>https://www.cnlab.ch</url>

    <scm>
        <connection>scm:git:git@git.cnlab.ch:dzimmermann/jfx-package-test.git</connection>
    </scm>

    <organization>
        <name>cnlab Software AG</name>
        <url>https://www.cnlab.ch</url>
    </organization>

    <licenses>
        <license>
            <name>Proprietary</name>
            <url>https://www.cnlab.ch</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>dzimmermann</id>
            <name>Daniel Zimmermann</name>
            <email>daniel.zimmermann@cnlab.ch</email>
        </developer>
    </developers>

    <repositories>
        <repository>
            <id>maven</id>
            <url>http://repo1.maven.org/maven2</url>
        </repository>

        <repository>
            <id>jcenter</id>
            <url>https://jcenter.bintray.com/</url>
        </repository>
    </repositories>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <main.basedir>${basedir}</main.basedir>

        <use.java.version>11</use.java.version>
        <javafx.version>11.0.2</javafx.version>
        <kotlin.version>1.3.61</kotlin.version>
        <!-- current Kotlin version does not support 13 as a target -->
        <kotlin.jvm.target>11</kotlin.jvm.target>

        <java.version>${use.java.version}</java.version>
        <maven.compile.java.version>${use.java.version}</maven.compile.java.version>
        <maven.compiler.source>${use.java.version}</maven.compiler.source>
        <maven.compiler.target>${use.java.version}</maven.compiler.target>

        <jackson.version>2.9.9</jackson.version>

        <javafx.plugin.version>0.0.3</javafx.plugin.version>
        <client.plugin.version>0.1.11</client.plugin.version>

        <app.main.class>ch.cnlab.jfx.test.AppKt</app.main.class>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-base</artifactId>
            <version>${javafx.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>${javafx.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>${javafx.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-media</artifactId>
            <version>${javafx.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-web</artifactId>
            <version>${javafx.version}</version>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>${kotlin.version}</version>
            <classifier>modular</classifier>
            <exclusions>
                <exclusion>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-stdlib-common</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jetbrains</groupId>
                    <artifactId>annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk7</artifactId>
            <version>${kotlin.version}</version>
            <classifier>modular</classifier>
            <exclusions>
                <exclusion>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-stdlib</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>${kotlin.version}</version>
            <classifier>modular</classifier>
            <exclusions>
                <exclusion>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-stdlib-jdk7</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-stdlib</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-reflect</artifactId>
            <version>${kotlin.version}</version>
            <classifier>modular</classifier>
            <exclusions>
                <exclusion>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-stdlib</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-kotlin</artifactId>
            <version>${jackson.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-reflect</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <pluginRepositories>
        <pluginRepository>
            <id>gluon-releases</id>
            <url>http://nexus.gluonhq.com/nexus/content/repositories/releases/</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.7.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <release>${use.java.version}</release>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <inherited>true</inherited>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            <addClasspath>true</addClasspath>
                        </manifest>
                        <manifestEntries>
                            <!-- custom entries -->
                            <Specification-Vendor>${project.organization.name}</Specification-Vendor>
                            <Specification-Version>${project.version}</Specification-Version>
                            <Specification-Title>${project.name}</Specification-Title>
                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
                            <Implementation-Version>${project.version}-${buildNumber}</Implementation-Version>
                            <Implementation-Title>${project.name}</Implementation-Title>
                            <!-- <Automatic-Module-Name>${project.groupId}.${project.artifactId}</Automatic-Module-Name> -->
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>kotlin-maven-plugin</artifactId>
                <groupId>org.jetbrains.kotlin</groupId>
                <version>${kotlin.version}</version>
                <configuration>
                    <!-- <compilerPlugins><plugin>spring</plugin></compilerPlugins> -->
                    <!-- Supported versions: 1.6, 1.8, 9, 10, 11, 12 -->
                    <jvmTarget>${kotlin.jvm.target}</jvmTarget>
                </configuration>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                                <sourceDir>${project.basedir}/src/main/java</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                                <sourceDir>${project.basedir}/src/test/java</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <!-- <dependency><groupId>org.jetbrains.kotlin</groupId><artifactId>kotlin-maven-allopen</artifactId><version>${kotlin.version}</version></dependency> -->
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>${javafx.plugin.version}</version>
                <configuration>
                    <!-- javafx:compile options -->
                    <source>${use.java.version}</source>
                    <target>${use.java.version}</target>
                    <release>${use.java.version}</release>
                    <mainClass>${app.main.class}</mainClass><!-- packagetest -->
                    <!-- javafx:jlink options -->
                    <jlinkImageName>${project.artifactId}</jlinkImageName>
                    <launcher>${project.artifactId}-launcher</launcher>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.gluonhq</groupId>
                <artifactId>client-maven-plugin</artifactId>
                <version>${client.plugin.version}</version>
                <configuration>
                    <!-- Uncomment to run on iOS: -->
                    <!-- <target>ios</target> -->
                    <mainClass>${app.main.class}</mainClass>
                    <graalvmHome>/home/daniel/programs/java/graalvm/graalvm-ce</graalvmHome>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>java</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>${app.main.class}</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Since the source contains a module-info.java I’m able to not just jlink it, but also create a package with the jpackager - only this final little piece called GraalVM is missing.

Any idea, what could cause the reflection problem? Or is it possible to pass the suggested parameter to the compile goal (-H:+AllowIncompleteClasspath, …)?

Thank you in advance! 😃 Daniel

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jperedadnrcommented, Jan 17, 2020

Yes, sorry, 0.1.12

I can get 13.0.2 from Maven central with the JavaFX plugins.

Glad that you have solved the issue and works for you.

0reactions
bgmfcommented, Jan 17, 2020

I think you mean Client plugin 0.1.12, right? The same as with 13.0.2 - can’t find it, yet. JavaFX plugin 0.0.4 can be found, though.

Thanks for the tip with the <reflectionList> entries - I really only had to add this one file! Now it starts in holy graal 0.3s (usr time) against 2.1s (usr time) when using a jpackaged version of the tool! Nice!

Since the application was purely for “fun”, testing the JavaFX-plugin and jpackage in conjunction with a simple modularized Kotlin app, there is not much more to expect. But I’m excited to get this far.

Thanks a lot @jperedadnr !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error parsing reflection configuration in picocli.json · Issue #622
The reason is that ReflectionConfigGenerator creates a json file where the fields of the super class are listed as fields of the concrete ......
Read more >
graalvm/native-image - Gitter
UserError$UserException: Error parsing resource configuration in /project/classes/reflection.json: first level of document must be an object Verify that the ...
Read more >
java.lang.NoClassDefFoundError errors when trying to run ...
I've tried going through every path I can think of with the client:runagent and this simply doesn't generate any entries to the reflect-config....
Read more >
sbt Reference Manual — Combined Pages
If you get an error like “Reference to undefined setting“, often you've failed to specify a scope, or you've specified the wrong scope....
Read more >
Gluon Client Plugin
This goal simply combines client:compile and client:link . ... For example, specifying reflection configuration for linux 64bit can be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found