Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Failed to instantiate [org.springframework.context.annotation.AnnotationConfigApplicationContext]: Constructor threw exception;
- nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException:
- Annotation-specified bean name 'myService' for bean class [my.package.ejb.MyService] conflicts with existing, non-compatible bean definition of same name and class [my.package.other.ejb.MyService]
- @Configuration
- @ComponentScan("my.package")
- @MapperScan("my.package")
- public class ApplicationConfiguration {
- @Bean
- public DataSource dataSource() {
- return new JndiDataSourceLookup().getDataSource("...");
- }
- @Bean
- public SqlSessionFactoryBean sqlSessionFactory(final DataSource dataSource) {
- final SqlSessionFactoryBean sqlSessionFactory = new SqlSessionFactoryBean();
- sqlSessionFactory.setDataSource(dataSource);
- sqlSessionFactory.setConfigLocation(new ClassPathResource("..."));
- return sqlSessionFactory;
- }
- @Bean
- public DataSourceTransactionManager dataSourceTransactionManager(final DataSource dataSource) {
- return new DataSourceTransactionManager(dataSource);
- }
- }
Add Comment
Please, Sign In to add comment