GraalVM native-image build error
See original GitHub issueBuilding example https://github.com/micronaut-projects/micronaut-data/tree/master/examples/example-jpa with native-image
produces binary (seems working) but shows errors.
Steps to Reproduce
- Checkout https://github.com/micronaut-projects/micronaut-data/tree/master/examples/example-jpa
- run
./gradlew assemble
- run
native-image --no-server -cp build/libs/example-jpa-0.1-all.jar
Expected Behaviour
Binary is produced and no errors are reported.
Actual Behaviour
Binary is produced and below errors are reported:
Error: Classes that should be initialized at run time got initialized during image building:
org.jboss.logging.Slf4jLocationAwareLogger was unintentionally initialized at build time. To see why org.jboss.logging.Slf4jLocationAwareLogger got initialized use -H:+TraceClassInitialization
org.jboss.logging.Logger was unintentionally initialized at build time. To see why org.jboss.logging.Logger got initialized use -H:+TraceClassInitialization
org.hibernate.internal.CoreMessageLogger_$logger was unintentionally initialized at build time. To see why org.hibernate.internal.CoreMessageLogger_$logger got initialized use -H:+TraceClassInitialization
org.jboss.logging.LoggerProviders was unintentionally initialized at build time. To see why org.jboss.logging.LoggerProviders got initialized use -H:+TraceClassInitialization
org.jboss.logging.LoggingLocale was unintentionally initialized at build time. To see why org.jboss.logging.LoggingLocale got initialized use -H:+TraceClassInitialization
org.jboss.logging.DelegatingBasicLogger was unintentionally initialized at build time. To see why org.jboss.logging.DelegatingBasicLogger got initialized use -H:+TraceClassInitialization
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1
Environment Information
- Operating System: Linux Fedora
- Micronaut Version: 1.2.9
- JDK Version:
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b06)
OpenJDK 64-Bit GraalVM CE 19.3.1 (build 25.242-b06-jvmci-19.3-b07, mixed mode)
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Fix GraalVM Native Image Build Issues - Simply-How.com
One of the most common problems when building native images are out of memory errors: Error: Image build request failed with exit status...
Read more >[GR-36396] Unable to build native image in GraalVM 22.1.0-dev
Describe the issue I'm unable to build a native image of a Java application with native-image from GraalVM CE 22.1.0-dev (build ...
Read more >Building a Native Executable - Quarkus
(Only for Oracle GraalVM CE/EE) Install the native-image tool using gu install : ... This means that you may see the following error...
Read more >Native Image - GraalVM
The Native Image builder or native-image is a utility that processes all classes of an application and their dependencies, including those from the...
Read more >Error building native image with gluonfx-maven-plugin 1.0.14
I'm trying to build a native image using: GraalVM: 22.2.0. GluonFx maven Plugin: 1.0.14. And I get the following error:
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed using the snapshots, as a workaround you can add the following flags:
And also add
com.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry[]
in the @TypeHint annotation in Application.java.@morki I recommend looking at https://github.com/micronaut-graal-tests/micronaut-data-jpa-graal/tree/h2 . Basically the same example but working with GraalVM.