-
Notifications
You must be signed in to change notification settings - Fork 17
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 image compilation failure on jooq.runtime.graal.DefaultRecordMapperSubstitutions.proxy #177
Comments
Digging, this is related to unmatchable subsitution of |
Digging further, since
and rebuilt a 999-SNAPSHOT. It solves the compilation error for "This error is reported at image build time because class org.jooq.impl.Tools is registered for linking at image build time by command line" It seems related to [2/8] Performing analysis... [] (33,5s @ 0,78GB)
|
Latest comments after jOOQ/jOOQ#8779 (comment) suggest JOOQ GraalVM support is planned for JOOQ 3.19.x and above I'm not sure if the root Should the quarkus-jooq plugin import these JPA classes to let resolution happen at graph construction ? |
I included jakarta.persistence as a dependency by adding a crude import of
Then graph analysis phase [2/8] Performing analysis works 🥳 I'll make a proper PR without depending on H8 for JPA |
please note that analysis and compilation work, but runtime will fail because micronaut solved this thru https://github.com/micronaut-projects/micronaut-sql/blob/master/src/main/docs/guide/jooq/jooq-graalvm.adoc and https://github.com/micronaut-projects/micronaut-sql/tree/master/jooq ( micronaut-projects/micronaut-sql#851 ) |
I can't pinpoint how to tell Quarkus how to generate reflection configuration for JOOQ The JOOQ gradle plugin successfully generates the Jakarta Persistence API annotations but when the native binary is run, these annotated Records don't exist in the closed world "classpath", I get linkage errors (at runtime, not compile/build time) I understand Micronaut-sql looks for annotations and generates an AFAIK Quarkus has a slightly different approach where it scans classes and generates a bytecode metamodel, and this metamodel generates the reflection configuration I was expecting QK to work "out of the box" and generate the metamodel for JOOQ Records annotated with JPA. It does not so I'm attempting to do a PR for quarkus-jooq, but I don't see where my "missing link" between a Record and its reflection configuration is. I'm no QK expert ;) Basically I want to augment the QK scanning process and tell it to add reflection for all public fields + constructor on JOOQ Records annotated with JPA I'm not sure if this should be a build time thing as in https://github.com/quarkiverse/quarkus-jooq/blob/main/deployment/src/main/java/io/quarkiverse/jooq/deployment/JooqProcessor.java or a runtime one as in https://github.com/quarkiverse/quarkus-jooq/tree/main/runtime/src/main/java/io/quarkiverse/jooq/runtime I believe the answer might be in https://github.com/quarkusio/quarkus/tree/main/extensions/hibernate-orm code because JPA-annotated H8 entities work, but I'm not sure. Or it could be simpler and simply adding a @ranjanashish or @angrymango would you have tips on how to do it ? |
I can confirm that removing or overruling DefaultRecordMapperSubstitutions.java does help, so I guess it can be removed from the source. @laurentperez the issues with jakarta and the reflection didn't occur for my project, so maybe this is more due to the use of micronaut? My project does use the records in the code and that way they get registered for reflection. |
I created a pull request for removing DefaultRecordMapperSubstitutions.java #188. |
Hello
Using latest tag 2.0.0 and quarkusPlatformVersion=3.4.3
Using container build (with Mandrel) :
./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true
Native compilation fails on graalvm side :
Stacktrace side :
The text was updated successfully, but these errors were encountered: