Using JpaRepository causes error in native code #19683
Labels
area/spring
Issues relating to the Spring integration
kind/bug
Something isn't working
triage/needs-reproducer
We are waiting for a reproducer.
Describe the bug
Using the spring-data-jpa extension, it is possible to use
JpaRepository
in JVM builds. But in native builds there is a runtime error caused by missing methods from the interface.For example with the repository definition
and injection of this interface into an application-scoped bean, then when running native the following error is reported:
Attaching
@RegisterForReflection
to the interface itself, or any of those in the inheritance hierarchy, does not appear to cure the issue.Expected behavior
It should be possible to use
JpaRepository
in native as well as JVM quarkus applications.Actual behavior
A
java.lang.IllegalArgumentException: Cannot find method
error is raised (see details above).How to Reproduce?
Steps to reproduce the behaviour:
JpaRepository<E, Long>
based on a simple entity E (could use h2 or other in-memory DB for convenience)If built for JVM the call will succeed, but when run native there will be a
java.lang.IllegalArgumentException: Cannot find method
error when the endpoint P is hit.Output of
uname -a
orver
MINGW64_NT-10.0-18363 LAP1453 3.0.7-338.x86_64 2019-04-30 21:52 UTC x86_64 Msys
Output of
java -version
openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment GraalVM CE 21.1.0 (build 11.0.11+8-jvmci-21.1-b05) OpenJDK 64-Bit Server VM GraalVM CE 21.1.0 (build 11.0.11+8-jvmci-21.1-b05, mixed mode, sharing)
GraalVM version (if different from Java)
OpenJDK Runtime Environment GraalVM CE 21.1.0 (build 11.0.11+8-jvmci-21.1-b05)
Quarkus version or git rev
2.1.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Additional information
Switching from
JpaRepository
toPanacheRepository
makes the issue go away.The text was updated successfully, but these errors were encountered: