You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect that dependency micronaut-vertx-pg-client add all the required GraalVM configuration in order to be able to compile/run my "micronaut-vertx-pg-client" application in native mode.
Actual Behaviour
Given a simple app with the following dependencies:
and then make a query to localhost:8080/postgres I am getting the following error:
.18:33:38.396 [vert.x-eventloop-thread-13] ERROR i.m.http.server.RouteExecutor - Unexpected error occurred: Could not initialize class io.vertx.pgclient.impl.codec.DataTypeCodec
java.lang.NoClassDefFoundError: Could not initialize class io.vertx.pgclient.impl.codec.DataTypeCodec
If I swap the graalVM config property initialize-at-run-time to initialize-at-build-time then I am getting the following compile error:
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: No instances of io.vertx.core.logging.SLF4JLogDelegate are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use --trace-object-instantiation=io.vertx.core.logging.SLF4JLogDelegate.
Because looks like pgClient internally is using a Log library that needs to be initialized at runtime but it also seems that DataTypeCodec needs to be initialized at build time, so looks like a chicken-egg problem
Expected Behavior
I would expect that dependency
micronaut-vertx-pg-client
add all the required GraalVM configuration in order to be able to compile/run my "micronaut-vertx-pg-client" application in native mode.Actual Behaviour
Given a simple app with the following dependencies:
App:
application.yml
When I compile my app with GraalVM
./gradlew clean nativeCompile
native-image.properties
reflection.json
and then make a query to
localhost:8080/postgres
I am getting the following error:If I swap the graalVM config property
initialize-at-run-time
toinitialize-at-build-time
then I am getting the following compile error:Because looks like pgClient internally is using a Log library that needs to be initialized at runtime but it also seems that DataTypeCodec needs to be initialized at build time, so looks like a chicken-egg problem
Steps To Reproduce
Just create a hello world app like this one:
and try to compile with GraalVM and make a Query to
/postgres
Environment Information
openjdk 17.0.5 2022-10-18
OpenJDK Runtime Environment GraalVM CE 22.3.0 (build 17.0.5+8-jvmci-22.3-b08)
Fedora 37
Example Application
No response
Version
3.8.7
The text was updated successfully, but these errors were encountered: