Cannot locate remote EJB via JNDI in Websphere 6.0
Hello!
I have found a problem with Spring in WebSphere server. There are two EJB applications running on the application server. When I try to call remote EJB placed in one application, from another application with Spring, I get the
following error:
org.springframework.remoting.RemoteLookupFailureEx ception: Failed to locate remote EJB [ejb/ee/seb/digi/core/ejb/facade/DocumentFacadeHome]; nested exception is javax.naming.NameNotFoundException: Context: B7041061Node01Cell/nodes/B7041061Node01/servers/server1, name: ejb/ee/seb/digi/core/ejb/facade/DocumentFacadeHome: First component in name ejb/ee/seb/digi/core/ejb/facade/DocumentFacadeHome not found.
At the same time, DocumentFacadeHome bean is accessible in WebSphere Universal Test Client and with standart lookup routines, which looks like:
DocumentFacadeHome aDocumentFacadeHome = (DocumentFacadeHome) ServiceLocatorManager.getRemoteHome(STATIC_Documen tFacadeHome_REF_NAME,
STATIC_DocumentFacadeHome_CLASS,
STATIC_DocumentFacadeHome_PROV_URL,
STATIC_DocumentFacadeHome_SERV_TYPE);
DocumentFacadeRemote aDocumentFacadeRemote = aDocumentFacadeHome.create();
String helloString = aDocumentFacadeRemote.hello("Mary");
Could you please help me?
My Spring configuration:
spring.xml:
<bean id="documentService" class="org.springframework.ejb.access.SimpleRemote StatelessSessionProxyFactoryBean" lazy-init="true">
<property name="jndiName">
<value>
ejb/ee/seb/digi/core/ejb/facade/DocumentFacadeHome
</value>
</property>
<property name="businessInterface">
<value>ee.seb.digi.core.business.DocumentService </value>
</property>
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.initial">
com.ibm.websphere.naming.WsnInitialContextFactory
</prop>
<prop key="java.naming.provider.url">iiop:///</prop>
</props>
</property>
<property name="lookupHomeOnStartup">
<value>false</value>
</property>
<property name="refreshHomeOnConnectFailure">
<value>true</value>
</property>
</bean>
<beans>
<bean id="digiService"
class="ee.seb.digi.logic.business.DigiServiceImpl" lazy-init="true">
<property name="documentService">
<ref bean="documentService" />
</property>
</bean>
2st EJB:
public class DigiFacadeBean extends AbstractStatelessSessionBean implements DigiService {
private DigiService service;
public void setSessionContext(SessionContext sessionContext) {
super.setSessionContext(sessionContext);
setBeanFactoryLocator(ContextSingletonBeanFactoryL ocator.getInstance());
setBeanFactoryLocatorKey("spring-context");
}
protected void onEjbCreate() throws CreateException {
service = (DigiService) getBeanFactory().getBean("digiService");
}
public String hello(String name) {
return service.hello(name); // <-- fails here
}
}


Reply With Quote