title: Spring - conflicts with existing, non-compatible bean definition of same name and class
body: <p>The specific exception is:</p>
  
  <pre><code>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]
  </code></pre>
  
  <p>Those <code>MyService</code> interfaces are not even annotated, they represent EJB 2.0 stateless beans.</p>
  
  <p>My annotation configuration is as follow.</p>
  
  <pre><code>@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);
      }
  }
  </code></pre>
  
  <p>Might be an incompatibility with <code>@MapperScan</code> (from MyBatis) and <code>@ComponentScan</code>?</p>
  
  <p>The exception come from the <code>SpringBeanAutowiringInterceptor</code> I'm using to Autowire EJB 3.0 fields.</p>