Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reference spring modules

 
Vish Shukla
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have 2 modularized spring projects, packaged as jar files, containing their own applicationContext.xml. I need to reference bean declarations of these xml in war file.

webapp.war
- WEB-INF
- dispatcher-servlet.xml (Need to reference bean1 and bean2 of module 1 & 2)
- lib
- module1.jar
- module1-applicationContext.xml
- bean1
- module2.jar
- module2-applicationContext.xml
- bean2

I tried referencing module1-applicationContext and module2-applicationContext from dispatcher-servlete.xml file with following.

<import resource="classpath:*-applicationContext.xml"/>

But when I try to access bean1 or bean2, getting no bean definition found exception. Can someone please suggest what kind of structure I should have to achieve this.

Thanks & Regards,
Vish Shukla
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic