Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

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

Closed
gtiwari333 opened this issue Oct 22, 2022 · 1 comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid

Comments

@gtiwari333
Copy link

gtiwari333 commented Oct 22, 2022

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) #1619.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 22, 2022
gtiwari333 added a commit to gtiwari333/spring-boot-blog-app that referenced this issue Oct 22, 2022
image generates fine.. but fails because of EntityGraph

Revisit after these two issues are fixed
- spring-attic/spring-native#1729
- spring-attic/spring-native#1728

Found a temp workaround for EntityManager injection with lombok
spring-attic/spring-native#1597
@sdeleuze
Copy link
Contributor

sdeleuze commented Oct 22, 2022

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 942d4dc, we will then add the related entry on metadata repository cc @christophstrobl @mhalbritter.

@sdeleuze sdeleuze added for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 22, 2022
@sdeleuze sdeleuze closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2022
gtiwari333 added a commit to gtiwari333/spring-boot-blog-app that referenced this issue Dec 5, 2022
* attempting to generate native image

image generates fine.. but fails because of EntityGraph

Revisit after these two issues are fixed
- spring-attic/spring-native#1729
- spring-attic/spring-native#1728

Found a temp workaround for EntityManager injection with lombok
spring-attic/spring-native#1597

* will get this corrected in master branch

* Merge branch 'master' into boot3-native

# Conflicts:
#	src/main/java/gt/app/domain/AppUser.java

* graalvm 22.3+ is required

* h2 required at compile time for graalvm native compile

* native image WIP

* now it works !

* now it works !

* spring-attic/spring-native#1597 is resolved in   spring boot 3

* spring-projects/spring-data-jpa#2681 is fixed

* spring-projects/spring-data-jpa#2681 is fixed

* spring-projects/spring-data-jpa#2681 is fixed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid
Development

No branches or pull requests

3 participants