This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 800

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: 1648
    
    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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with multiple data sources in mybatis+spring
 
Similar Threads
Spring JUnit error
How do I ignore "The entity "raquo" was referenced, but not declared." exceptions?
How do I write an Xpath expression that selects two nodes?
Spring and Hibernate problem
Trouble parsing a well-formed file with a defined entity reference