micronaut-core icon indicating copy to clipboard operation
micronaut-core copied to clipboard

JPA App working on JVM fails with "org.hibernate.AnnotationException" when running native

Open tmohme opened this issue 2 years ago • 0 comments

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

  1. run ./gradlew dockerBuild
  2. run 'docker run demo:latest' => should work
  3. run ./gradlew dockerBuildNative
  4. 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)

Example Application

https://github.com/tmohme/mn-defect-demo

Version

3.6.0

tmohme avatar Aug 12 '22 15:08 tmohme