0 Replies Latest reply on Aug 13, 2002 10:32 AM by pep

    cannot lookup local ejb's inside another ejb

    pep Newbie

      Hi,
      I'm using jboss-tomcat 3.1.0 alpha and I'm having problems when I lookup local interfaces from one ejb to others.

      I'm trying to connect from a servlet to a stateless session bean and it's ok. But then, I cannot connect from the sesssion bean to all the other ejb's. I have declared all the ejb's as local. When I try to connect to a ejb I get this error :


      2002-08-13 14:31:44,123 ERROR [STDERR] java.rmi.ServerException: null; CausedByException is:
      null; nested exception is: javax.ejb.EJBException: null; CausedByException is: null
      2002-08-13 14:31:44,153 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:119)

      In the session bean I call the ejb as :

      CustomerHomeLocal customerHome = (CustomerHomeLocal)ctx.lookup( "java:comp/env/ejb/CustomerHomeLocal" );
      CustomerLocal customerlocal= customerHome.create(customerid);

      my ejb-jar.xml is :

      ...

      <ejb-name>FacadeEJB</ejb-name>
      com.mtp.store.ejb.facade.FacadeHomeRemote
      com.mtp.store.ejb.facade.FacadeRemote
      <ejb-class>com.mtp.store.ejb.facade.FacadeBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <ejb-local-ref>
      <ejb-ref-name>ejb/CustomerHomeLocal</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>com.mtp.store.ejb.customer.CustomerHomeLocal</local-home>
      com.mtp.store.ejb.customer.CustomerLocal
      <ejb-link>CustomerEJB</ejb-link>
      </ejb-local-ref>
      <ejb-local-ref>

      ...

      and my jboss.xml is :

      <enterprise-beans>

      <ejb-name>ProductEJB</ejb-name>
      <local-jndi-name>ejb/ProductHomeLocal</local-jndi-name>


      <ejb-name>FacadeEJB</ejb-name>
      <jndi-name>FacadeHomeRemote</jndi-name>
      <ejb-local-ref>
      <ejb-local-ref-name>ejb/CustomerHomeLocal</ejb-local-ref-name>
      <jndi-name>CustomerHomeLocal</jndi-name>
      </ejb-local-ref>

      ...


      In http:localhost:8082 - JNDIView I can see all the ejb's :

      java:comp namespace of the CustomerEJB bean:
      +- env (class: org.jnp.interfaces.NamingContext)


      java:comp namespace of the FacadeEJB bean:
      +- env (class: org.jnp.interfaces.NamingContext)
      | +- ejb (class: org.jnp.interfaces.NamingContext)
      | | +- ProductHomeLocal[link -> ProductHomeLocal] (class: javax.naming.LinkRef)
      | | +- CustomerHomeLocal[link -> CustomerHomeLocal] (class: javax.naming.LinkRef)


      Has anyone got this problem before ?

      Thanks a lot !