New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EntityManagerBeanDefinitionRegistrarPostProcessor
does not ensure unique SharedEntityManagerCreator
beans
#2699
Comments
@imperatorx thanks for the report but can you please share a small sample we can run ourselves? We do have smoke test for such trivial config and they are green. |
It's the injection of an diff --git a/data/data-jpa/src/main/java/com/example/data/jpa/CLR.java b/data/data-jpa/src/main/java/com/example/data/jpa/CLR.java
index 8b8ac80..612a374 100644
--- a/data/data-jpa/src/main/java/com/example/data/jpa/CLR.java
+++ b/data/data-jpa/src/main/java/com/example/data/jpa/CLR.java
@@ -5,6 +5,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Set;
+import jakarta.persistence.EntityManager;
import com.example.data.jpa.model.Author;
import com.example.data.jpa.model.Book;
@@ -19,7 +20,7 @@ class CLR implements CommandLineRunner {
private final BookRepository bookRepository;
- CLR(AuthorRepository authorRepository, BookRepository bookRepository) {
+ CLR(AuthorRepository authorRepository, BookRepository bookRepository, EntityManager entityManager) {
this.authorRepository = authorRepository;
this.bookRepository = bookRepository;
} |
Sure here it is: https://github.com/imperatorx/reproducer-entitymanager |
It looks like |
EntityManagerBeanDefinitionRegistrarPostProcessor
does not ensure unique SharedEntityManagerCreator
beans
The underlying problem is that multiple runs of |
3.0.0-RC2 (and 1 too)
Given a trivial config:
And datasource configured:
And a
@Component
@Autowire
-ing anEntityManager
, the application fails to start when compiled withmvnw -Pnative native:compile
, but starts normally when started in java mode from the IDE:The text was updated successfully, but these errors were encountered: