5 Replies Latest reply on Sep 8, 2004 10:56 AM by jae

    invoke EJB session bean across applications

    S T Newbie

      Hi,

      Has anyone of you tried to invoke an EJB which is deployed in a seperate application within the same server (i.e. same host and deployed in the same server deploy directory)? I searched the web and found a site at http://www.huihoo.com/jboss/online_manual/3.0/ch07s13.html and used
      the "External EJB reference" deployment method but I keep getting Class cast exception when trying to call the PortableRemoteObject.narrow(Object, Class) method. I am using jboss 3.2.2 and is pretty sure that the error is not caused by the code since I am able to access the same bean from another server.

      I have been looking around for solution for hours and still couldn't find anything that helps... : (

      Your help is greatly apprieciated.

      Below are my set up:

      ejb-jar.xml:

       <session>
       <ejb-name>BeanA</ejb-name>
       <local-home>bean_a_package.IBeanALocalHome</local-home>
       <local>bean_a_package.IBeanALocal</local>
       <ejb-class>bean_a_package.BeanA</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
       <ejb-ref>
       <ejb-ref-name>
       BeanB
       </ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <home>bean_b_package.IBeanBRemoteHome</home>
       <remote>bean_b_package.IBeanBRemote</remote>
       </ejb-ref>
       </session>
      
      
      jboss.xml:
      
       <session>
       <ejb-name>BeanA</ejb-name>
       <jndi-name>BeanA</jndi-name>
       <local-jndi-name>IBeanALocalHome</local-jndi-name>
       <ejb-ref>
       <ejb-ref-name>BeanB</ejb-ref-name>
       <jndi-name>jnp://localhost:1099/applicationB/BeanB</jndi-name>
       </ejb-ref>
       </session>