Hi, This is what you should do to access ejb from another ejb. For more details you can refer to DD chapter of ejb specs This is taked from ejb spec: The ejb-link element is used in the ejb-ref element to specify that an EJB reference is linked to another enterprise bean. The value of the ejb-link element must be the ejb-name of an enter-prise bean in the same ejb-jar file, or in another ejb-jar file in the same J2EE application unit. Alternatively, the name in the ejb-link element may be composed of a path name specifying the ejb-jar containing the referenced enterprise bean with the ejb-name of the target bean appended and separated from the path name by # . The path name is relative to the jar file con-taining the referencing component. This allows multiple enterprise beans with the same ejb-name to be uniquely identified. Used in: ejb-entity-ref, ejb-ref Example: <ejb-link>EmployeeRecord</ejb-link> Example for entity beans that exist in other ejb-jar files in the same J2EE unit: <ejb-link>../products/products.jar#PrductEJB</ejb-link> Example: <ejb-entity-ref> <description> This is a reference descriptor for an order bean which is used in product.jar </description> <remote-ejb-name>OrderEJB</remote-ejb-name> <ejb-ref-name>ejb/Order</ejb-ref-name> <home>com.commercewarehouse.catalog.OrderHome</home> <remote>com.commercewarehouse.catalog.Order</remote> <ejb-link>../orders/orders.jar#OrderEJB</ejb-link> </ejb-entity-ref> --> ======================== Cheers Ashwani Kalra Aithent Technologies India http://www.geocities.com/ashwani_kalra/ ========================= -----Original Message----- From: A mailing list for Enterprise JavaBeans development [mailto:[EMAIL PROTECTED]]On Behalf Of Oisin Kim Sent: Thursday, August 16, 2001 12:27 AM To: [EMAIL PROTECTED] Subject: What do I have to do to get EJBs to communicate with each other? Hello all, this is a repost the last mail didn't show but I've made some progress and narrowed down the cause of my problem. I'm having great difficulties trying to get ejb to ejb communication. I have Entity and Session EJBs that are deployed fine, I know this since they work from regular java clients, I can contact all the ejbs from a single client using their JNDI namespaces.The problem comes when I try to reference an ejb from another ejb it gives me the following exception, java.lang.ClassCastException at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemo teObject.java:296) at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137) at SimpleEntityBean.Submit(SimpleEntityBean.java:261) at SimpleEntity_EntityBeanWrapper1.Submit(SimpleEntity_EntityBeanWrapper1.java: 268) at java.lang.reflect.Method.invoke(Native Method) at com.evermind._dh._gc(Unknown Source) at com.evermind._if.run(Unknown Source) This happens as soon as I try to create an home object in an ejb that references another ejb using the PortableRemoteObject.narrow(ref,OtherSimpleBean.class) method. This code above is where the exception is being thrown. Is there something I need to do to tell ejbs about one another? I've deployed all the beans in a sinlge jar file and also in individual jar files but all to no avail. Any help is greatly appreciated, I am desparate! Best Regards, Oisin =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
