spring-projects / spring-projects/spring-boot

HibernateJpaAutoConfiguration does not back off despite LocalContainerEntityManagerFactory beans being declared manually

Open
#5,542 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

If you remove the manual exclusion for the HibernateJpaAutoConfiguration here the application bootstrap will blow up trying to apply the auto configuration and failing to wire the unique DataSource expected to be present. I wonder why the configuration is getting applied in the first place, as I would've expected the manual declarations of LocalContainerEntityManagerFactoryBeans here and here to disable the auto-configuration in the first place.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the bootstrap failure in the spring-data-examples jpa/multiple-datasources sample after removing the HibernateJpaAutoConfiguration exclusion in Application.java. Read the manual LocalContainerEntityManagerFactoryBean declarations in customer/CustomerConfig.java and order/OrderConfig.java, then inspect the related Spring Boot auto-configuration behavior. Done means the reported interaction is corrected or its expected behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.