Guest User

Untitled

a guest
May 26th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. Failed to instantiate [org.springframework.context.annotation.AnnotationConfigApplicationContext]: Constructor threw exception;
  2. nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException:
  3. 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]
  4.  
  5. @Configuration
  6. @ComponentScan("my.package")
  7. @MapperScan("my.package")
  8. public class ApplicationConfiguration {
  9. @Bean
  10. public DataSource dataSource() {
  11. return new JndiDataSourceLookup().getDataSource("...");
  12. }
  13.  
  14. @Bean
  15. public SqlSessionFactoryBean sqlSessionFactory(final DataSource dataSource) {
  16. final SqlSessionFactoryBean sqlSessionFactory = new SqlSessionFactoryBean();
  17. sqlSessionFactory.setDataSource(dataSource);
  18. sqlSessionFactory.setConfigLocation(new ClassPathResource("..."));
  19. return sqlSessionFactory;
  20. }
  21.  
  22. @Bean
  23. public DataSourceTransactionManager dataSourceTransactionManager(final DataSource dataSource) {
  24. return new DataSourceTransactionManager(dataSource);
  25. }
  26. }
Add Comment
Please, Sign In to add comment