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
The application should run native when built with "./gradlew clean dockerBuildNative" the same way as it runs when built with "./gradlew dockerBuild".
Actual Behaviour
When running the native application, I get a org.hibernate.AnnotationException: com.example.DemoClassId has no persistent id property: com.example.DemoClass.id
run 'docker run demo:latest' => fails with org.hibernate.AnnotationException: com.example.DemoClassId has no persistent id property: com.example.DemoClass.id
Environment Information
macOS 12.5, Intel CPU
OpenJDK 64-Bit Server VM Zulu11.56+19-CA (build 11.0.15+10-LTS, mixed mode)
Thank you for your suggestion.
I'm aware that Hibernate makes heavy use of reflection.
Nevertheless I was under the assumption, that Micronaut already takes care of this . . . because Micronaut has dedicated support for Hibernate and - apart from @EmbeddedId - everything works fine in the native app.
Anyway, adding @ReflectiveAccess to the DemoClassId class was enough to solve the problem for me.
It looks like Micronaut somehow manages this (letting the Annotation survive native-compile) automatically for other JPA Annotations.
Maybe it would be worthwhile to extend this support to include @EmbeddedId.
yawkat
transferred this issue from micronaut-projects/micronaut-core
Aug 15, 2022
Expected Behavior
The application should run native when built with "./gradlew clean dockerBuildNative" the same way as it runs when built with "./gradlew dockerBuild".
Actual Behaviour
When running the native application, I get a
org.hibernate.AnnotationException: com.example.DemoClassId has no persistent id property: com.example.DemoClass.id
Steps To Reproduce
clone https://github.com/tmohme/mn-defect-demo, then
./gradlew dockerBuild
./gradlew dockerBuildNative
org.hibernate.AnnotationException: com.example.DemoClassId has no persistent id property: com.example.DemoClass.id
Environment Information
Example Application
https://github.com/tmohme/mn-defect-demo
Version
3.6.0
The text was updated successfully, but these errors were encountered: