I am using the following code to load my object from an EJB (not using Spring's EJB classes):
It is bean called during ejbCreate()Code:public void setBeanContextName(String ctxName) { beanContextName = ctxName; } public String getBeanContextName() { return beanContextName; } public Object getBean(String bean) { BeanFactoryLocator bfl = SingletonBeanFactoryLocator.getInstance(); BeanFactoryReference bf = bfl.useBeanFactory(beanContextName); return bf.getFactory().getBean(bean); }
I have my beanRefFactory in the root directory of my EJB jar. The contents is as follows:
I get the following exception:Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="my.beans" class="org.springframework.context.support.ClassPathXmlApplicationContext"> <constructor-arg> <list> <value>springCommon.xml</value> <value>META-INF/springContext.xml</value> </list> </constructor-arg> </bean> </beans>
org.springframework.beans.FatalBeanException: Unable to find resource for specified definition. Group resource name [classpath*:beanRefFactory.xml], factory key [my.beans]
As far as I can tell this exception means beanRefFactory.xml wasn't found in the path. Isn't the root of an EJB jar implicitly put in the classpath when calling code from inside the EJB?


Reply With Quote