Skip to content

GraalVM native-image build error #409

@morki

Description

@morki

Building 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

  1. Checkout https://github.com/micronaut-projects/micronaut-data/tree/master/examples/example-jpa
  2. run ./gradlew assemble
  3. 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)

Metadata

Metadata

Assignees

Labels

type: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions