wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Problem with multiple data sources in mybatis+spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problem with multiple data sources in mybatis+spring" Watch "Problem with multiple data sources in mybatis+spring" New topic
Author

Problem with multiple data sources in mybatis+spring

chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806

Hi all, I am trying to configure 2 data sources in my project. I wrote thisWhen I try to execute a query it is giving me the following exceptionLater I came to know that the problem is with having multiple data sources. I removed the first data source and the associated sqlSessionFactory. Then I was able to run test case. If I include both then I am getting this error.

Can anyone please tell me how to fix this?


Love all, trust a few, do wrong to none.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1652
    
    7

I have not used myBatis (used it on a project back when it was iBatis) so I am not an expert but it looks like that error occurs when the below 3 names don't match, so your problem may not be a problem so much with multiple datasources but with the naming on one of them.

Verify this:

The three names that have to match:
- interface = xxx.yyy.zzz.mappers.SettingMapper.class
- mapper file = /xxx/yyy/zzz/mappers/SettingMapper.xml
- mapper namespace = xxx.yyy.zzz.mappers.SettingMapper



[How To Ask Questions][Read before you PM me]
 
GeeCON Prague 2014
 
subject: Problem with multiple data sources in mybatis+spring