spring-attic / spring-native

Spring Native is now superseded by Spring Boot 3 official native support
https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html
Apache License 2.0
2.74k stars 356 forks source link

Getting "The EntityGraph-Feature requires at least a JPA 2.1 persistence provider" error with Spring Boot 3.0.0-RC1 #1728

Closed gtiwari333 closed 1 year ago

gtiwari333 commented 1 year ago

See this: https://github.com/gtiwari333/spring-native-error

I've a simple setup with latest Spring Boot 3.0.0.RC1 where im using EntityGraph and getting a runtime error as following from the native image:

org.springframework.dao.InvalidDataAccessApiUsageException: The EntityGraph-Feature requires at least a JPA 2.1 persistence provider

Code:

    @EntityGraph(attributePaths = {"comments"})
    List<Note> findAll();

I'm using GraalVM CE 22.2.0.

~/Downloads/demo$ java -version
openjdk version "17.0.4" 2022-07-19
OpenJDK Runtime Environment GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06)
OpenJDK 64-Bit Server VM GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06, mixed mode, sharing)

I noticed there was a similar issue opened in past (now closed) https://github.com/spring-projects-experimental/spring-native/issues/1619.

sdeleuze commented 1 year ago

First please notice Spring Boot 3 requires GraalVM 22.3, it seems you tested with 22.2 so please upgrade by downloading it from https://bell-sw.com/pages/downloads/native-image-kit/#/nik-22-17-ea or SDKman.

This issue tracker is for Spring Native experimental project. If you still see the error with GraalVM 22.3, I guess you should raise it on https://github.com/spring-projects/spring-data-jpa by mentioning https://github.com/spring-projects-experimental/spring-native/commit/942d4dcd504fb173611c48f0937dee7a80160cec, we will then add the related entry on metadata repository cc @christophstrobl @mhalbritter.