Announcement Announcement Module
Collapse
No announcement yet.
Cannot locate remote EJB via JNDI in Websphere 6.0 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot locate remote EJB via JNDI in Websphere 6.0

    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
    }
    }

  • #2
    Hi Soir,

    What version of the framework are you using? I had very similar problems with WLS8.1 and both the M2 and M3 releases. Version 1.2.6 was definately OK and I have just downloaded the latest M4 build and this is also now working for me.

    Regards

    Steve

    Comment


    • #3
      Originally posted by smcardle
      Hi Soir,

      What version of the framework are you using? I had very similar problems with WLS8.1 and both the M2 and M3 releases. Version 1.2.6 was definately OK and I have just downloaded the latest M4 build and this is also now working for me.

      Regards

      Steve
      I use 1.2.6.

      BTW, I have found solution of the problem. I just renamed the long JNDI name "ejb/ee/seb/digi/core/ejb/facade/DocumentFacadeHome" into the short "ejb/DocumentFacadeHome" and it works.

      Comment

      Working...
      X