Spring with MyBatis: expected single matching bean but found 2
I've been using Spring with MyBatis and it's been working really well for a single database. I ran into difficulties when trying to add another database (see reproducible example on Github ). I'm using Spring Java configuration (i.e. not XML). Most of the examples I've seen show how to achieve this using XML. I have two data configuration classes (A & B) like this: @Configuration @MapperScan("io.woolford.database.mapper") public class DataConfigDatabaseA { @Bean(name="dataSourceA") public DataSource dataSourceA() throws SQLException { SimpleDriverDataSource dataSource = new