We're using Spring 1.1.5, and this seemed like an appropriate place to ask, so here goes:
We're using a single ear, but multiple wars, ejb jars, and dao jars.
We have adopted a layered approach (dao separate from ejb, etc.), but we're running into that
"Overriding bean definition message" repeatedly.
In our packaging scheme, we use a beanRefContext.xml file in each jar. In each jar, the beanRefContext.xml file is actually a ClassPathXmlApplicationContext which pulls in the definitions of the beans, the datasource, and the hibernate sessionFactory. The ClassPathXmlApplicationContext is named according to the jar name (to avoid conflicts).
Each of the EJBs uses the classpath*:beanRefContext.xml as the BeanFactoryPath. I've toyed with web.xml and its settings for the ContextLoaderListener.
The documentation on 1.1.5 points out:
"However, if there are multiple sibling web-apps at the top of the hierarchy, it is problematic to create an ApplicationContext for each web-app which consists of mostly identical bean definitions from lower layers, as there may be issues due to increased memory usage, issues with multiple copies of beans... and possible issues due to side-effects."
The documentation then suggests using the ContextSingletonBeanFactoryLocator or the SingletonBeanFactoryLocator - but how?
I quickly tried extending the AbstractStatelessSessionBean to use the ContextSingletonBeanFactoryLocator, but, at first blush, that didn't seem to work.
Any suggestions?
Thanks so much (in advance)!


Reply With Quote