I have defined a trivial SpringBoot Hibernate app, copy-pasted from sample code found in a random site on the Internet. The hopefully relevant portions of my spring.xml look like this:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
... details ommitted ...
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
... details ommitted ...
<bean id="transactionManager"
class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
Why do I get this error?
The bean 'org.springframework.transaction.config.internalTransactionAdvisor', defined in class path resource [org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.class], could not be registered. A bean with that name has already been defined in null and overriding is disabled.
Other things I have already tried
- Using
org.springframework.jdbc.datasource.DataSourceTransactionManager- same error - Using
org.springframework.orm.jpa.JpaTransactionManager- same error - Removing the
transactionManagerbean - ok my SpringBoot app works but now all my JUnit tests break