-
Feb 23rd, 2006, 10:47 AM
#1
call ejb from another ejb
Hi,
i try to call a session bean from another session bean by local interfaces in JBOSS 3.2.3
I configure in right way the xml descriptor.
example:
<bean id="ejb" class="org.springframework.ejb.access.LocalStatele ssSessionProxyFactoryBean" >
<property name="jndiName">
<value>TestEjbStateless</value>
</property>
<property name="resourceRef">
<value>true</value>
</property>
<property name="businessInterface">
<value>com.dp2k.study.test.stateless.TestEjbStatel essLocal</value>
</property>
</bean>
I get the spring context with:
-->BeanFactoryLocator beanFactoryLocator = ContextSingletonBeanFactoryLocator.getInstance("ME TA-INF/beanRefContext.xml");
and then the fBeanFactory from beanFactoryLocator:
--> BeanFactoryReference br = beanFactoryLocator.useBeanFactory("SpringCtxTest") ;
--> logger.debug("Ottenuto beanFactoryReference");
--> BeanFactory beanFactory = br.getFactory();
and i get the ejb reference from beanFactory:
-->TestEjbStatelessLocal testLocal = (TestEjbStatelessLocal) factory.getBean("ejb");
the problem is :
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'ejb' defined in class path resource [META-INF/applicationContext.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: TestEjbStateless not bound[/B][/I]
the ejb session object is deployed successfully .
If i try to get ejb reference via traditional Locator (jndi loockup) i get the right reference.
any suggestion for this issue?
thanks
Last edited by maurix; Feb 24th, 2006 at 05:12 AM.
-
Mar 8th, 2006, 08:21 AM
#2
Try setting "lookupHomeOnStartup" property to "false" on your SimpleRemoteStatelessSessionBeanProxyFactoryBean.
Hope this helps,
Andreas
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules