Hi.
I am trying to get a common BeanFactory instance between 4 EJB:s (1ssb and 3 mdb:s) in Websphere 5.0.
I have had my exact same configuration working in JBoss, but for some reason, I am not able to achieve the same effect in WAS, because each EJB will create its own hierarchy of beans.
My aim is to have shared instances of a few objects between these EJB's.
At the moment, I my code looks like this:
public void onEjbCreate() {
BeanFactory factory = null;
BeanFactoryLocator locator = ContextSingletonBeanFactoryLocator
.getInstance("META-INF/spring-context.xml");
BeanFactoryReference ref = locator.useBeanFactory("context");
factory = ref.getFactory();
dispatcher = (MessageDispatcher) factory.getBean("responseDispatcher");
}
I have also tried using SingletonBeanFactoryLocator with no effect.
the spring-context.xml looks like this (excluding header-stuff):
<beans>
<bean id="context" class="org.springframework.context.support.ClassPa thXmlApplicationContext">
<constructor-arg>
<list>
<value>META-INF/esb.xml</value>
<value>META-INF/esb.xml</value>
</list>
</constructor-arg>
</bean>
</beans>
The esb.xml in turn contains bean-configurations for all the beans that I want to access.
Any help with this would be grately appreciated, as I have been banging my head against the wall quite a while at the moment..


Reply With Quote