-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Failure analysis description for BeanDefinitionOverrideExceptions includes useless information when a bean definition has no resource description #18721
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
Comments
@fabiomilson Thanks for the report. The root cause of the error is the fact that two Spring Data projects are active and both are trying to implement the I assume you just want JPA so you can remove the following lines from your <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency> The error message is quite unhelpful, so I'll leave this issue open to see if we can improve that. |
I think the root cause of this is a bug in Spring Data. It should enter strict mode when multiple stores are detected. In strict mode, Spring Data JPA alone would handle We should still improve the error message. The mentions of |
FWIW, I see the same failure both with and without DevTools. |
This is an issue in Spring Data JDBC that is going to be addressed with DATAJDBC-437. |
Here's the failure analysis that we should improve:
"defined in null" is appearing because the bean definition has a |
…laim repository interfaces anymore. Previously, a module not exposing any entity identifying annotations would have claimed a repository definition and potentially overrode the bean definition of another store that was the proper claim in the first place. We have now changed this to abstain from a claim of the interface. We' also tweaked the log output in the following cases: 1. If the module neither returns an identifying type nor entity identifying annotations, we now log a warning that a module does not support a multi-module setup and answer all assignment requests with false. 2. The info level warning indicating an interface has been dropped now reports which annotations or interface base types to use. Related tickets: spring-projects/spring-boot#18721
…laim repository interfaces anymore. Previously, a module not exposing any entity identifying annotations would have claimed a repository definition and potentially overrode the bean definition of another store that was the proper claim in the first place. We have now changed this to abstain from a claim of the interface. We' also tweaked the log output in the following cases: 1. If the module neither returns an identifying type nor entity identifying annotations, we now log a warning that a module does not support a multi-module setup and answer all assignment requests with false. 2. The info level warning indicating an interface has been dropped now reports which annotations or interface base types to use. Original pull request: #411. Related tickets: spring-projects/spring-boot#18721
…laim repository interfaces anymore. Previously, a module not exposing any entity identifying annotations would have claimed a repository definition and potentially overrode the bean definition of another store that was the proper claim in the first place. We have now changed this to abstain from a claim of the interface. We' also tweaked the log output in the following cases: 1. If the module neither returns an identifying type nor entity identifying annotations, we now log a warning that a module does not support a multi-module setup and answer all assignment requests with false. 2. The info level warning indicating an interface has been dropped now reports which annotations or interface base types to use. Original pull request: #411. Related tickets: spring-projects/spring-boot#18721
…laim repository interfaces anymore. Previously, a module not exposing any entity identifying annotations would have claimed a repository definition and potentially overrode the bean definition of another store that was the proper claim in the first place. We have now changed this to abstain from a claim of the interface. We' also tweaked the log output in the following cases: 1. If the module neither returns an identifying type nor entity identifying annotations, we now log a warning that a module does not support a multi-module setup and answer all assignment requests with false. 2. The info level warning indicating an interface has been dropped now reports which annotations or interface base types to use. Original pull request: #411. Related tickets: spring-projects/spring-boot#18721
…laim repository interfaces anymore. Previously, a module not exposing any entity identifying annotations would have claimed a repository definition and potentially overrode the bean definition of another store that was the proper claim in the first place. We have now changed this to abstain from a claim of the interface. We' also tweaked the log output in the following cases: 1. If the module neither returns an identifying type nor entity identifying annotations, we now log a warning that a module does not support a multi-module setup and answer all assignment requests with false. 2. The info level warning indicating an interface has been dropped now reports which annotations or interface base types to use. Original pull request: #411. Related tickets: spring-projects/spring-boot#18721
We've got |
Hello, I come to report that the following bug can be reproduced (Spring Boot 2.2.0.RELEASE):
1 - Use the dependencies:
spring-boot-starter-data-jdbc, spring-boot-starter-data-jpa, spring-boot-starter-web, spring-boot-devtools, mysql-connector-java, lombok, spring-boot-starter-test, junit-vintage-engine
2 - Create a repository interface and extending entity JpaRepository
3 - Following error is displayed when starting the spring application using Spring Tool Suite 4:
The bean 'personRepository', defined in null, could not be registered. A bean with that name has already been defined in null and overriding is disabled.
4 - When removing the spring-boot-devtools dependency the error no longer occurs.
5 - When starting the spring application with the spring-boot-devtools dependency it is possible to verify that the application's Main method is invoked twice.
6 - Example:
public static void main (String [] args) { System.out.println ("test"); SpringApplication.run (XXXApplication.class, args); }
example.zip
The text was updated successfully, but these errors were encountered: