0

in the <context:component-scan base-package= is there any diference in doing com.mycompany.proyect.dao or com.mycompany. I have this doubt because in both ways works. I have a project A that access some data, this project is packed as a jar, then the project B imports project A. Both have different package structure like com.mycompany.proyectA.dao and com.mycompany.proyectB.dao. So, to make the component scanning work. i declared the context:component-scan as follows com.mycompany. I must to say that this declaration is working, but in every example in spring (or other places) always use com.mycompany.dao. Are there some issues working in this way?

Thank you.

OJVM
  • 1,403
  • 1
  • 25
  • 37

1 Answers1

1

As far as I can tell, there seems to some conflict between DAO methods in com.mycompany.proyectA.dao and com.mycompany.proyectB.dao

The solution is to split into 2 context:component-scan one for projectADao and one for projectBDao.

Further more you can split the context:component-scan in 2 xml files like daoA.xml and daoB.xml and then have a context:component-scan in each , ex: context:component-scan as com.mycompany.proyectA.dao and context:component-scan as com.mycompany.proyectB.dao respectively.

  • It sounds good and i think it might work, but my question is about the issues declaring com.mycompany.dao or just declaring com.mycompany. Thank you. – OJVM Sep 18 '12 at 16:16