• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with multiple data sources in mybatis+spring

 
Ranch Hand
Posts: 806
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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


 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic