I've a scenario that involves multiple EJB jars and a WAR that need to be packaged inside a single EAR. This project uses Spring. Originally the ejb jars were deployed separately and the war as well.
Each ejb jar has a beanRefContext.xml which in turn references a config xml that has the beans defined for that ejb project. Each ejb module has it's own daos and services...the services are autowired into the stateless EJBs.
The war also has [servlet-name]-servlet.xml which has the beans defined as well the entries that are injected into the Controller classes.
Now packaging this together in a single EAR fails on deployment because there're multiple beanRefContext.xml files. How do I accomplish this? So as a POC:
mod1-ejb.jar has beanRefContext.xml - loads mod1-context.xml (beans defined to be used in mod1)
mod2-ejb.jar has beanRefContext.xml - loads mod2-context.xml (beans defined to be used in mod2)
mod-web.war has webapp-servlet.xml...the war module has 'Controller' classes that utilize ejbs from both mod1-ejb and mod2-ejb. How can I make this work in a single EAR? With a single EJB module and WAR module it's fine because there is just one beanRefContext.xml
Also each ejb module uses it's own resource bundle like error.properties, message.properties etc...