Forums Register Login

how to call an ejb from ejb in Weblogic 7

+Pie Number of slices to send: Send
I have made two cmp's
1st is AccountManaged
2nd is EjbCustomer
Both having Local home and local component
I then have inserted in ejb-jar.xml

<entity>
<ejb-local-ref>
<description>Reference to application EJB</description>
<ejb-ref-name>ejb_D1</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>examples.ejb20.basic.containerManaged.CustHome</local-home>
<local>examples.ejb20.basic.containerManaged.Customer</local>
<ejb-link>ejb_D1.jar#EjbCustomer.CustHome</ejb-link>
</ejb-local-ref>
</entity>
then error at deploying my ejb_D1.jar is javax.naming.namenotfoundException
Unable to resolve ejb link
ejb_D1.jar#EjbCustomer.CustHome
And when i made changes to ejb-jar.xml as
<ejb-local-ref>
<description>Reference to application EJB</description>
<ejb-ref-name>AccountManaged</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>examples.ejb20.basic.containerManaged.AccountHome</local-home>
<local>examples.ejb20.basic.containerManaged.Account</local>
<ejb-link>AccountManaged.AccountHome</ejb-link>
</ejb-local-ref>
</entity>

Then error at deployment of ejb_D1.jar is could not resolve ejb-link

Also at
In weblogic-ejb-jar.xml i have inserted

<weblogic-ejb-jar>

<weblogic-enterprise-bean>
<ejb-name>EjbCustomer</ejb-name>
<entity-descriptor>
<persistence>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-use>
</persistence>
</entity-descriptor>
<local-jndi-name>EjbCustomer.CustHome</local-jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
Please help me regarding this......Tell me how in local or remote can we call an EJB from EJB
+Pie Number of slices to send: Send
Hi,
Its possible to call one ejb from another by defining one ejb as a remote and other as local.
weblogic-ejb-jar.xml
====================
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN'
'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>PlayerEJB</ejb-name>
<jndi-name>JNDIPlayer</jndi-name>
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
<ejb-name>EREJB</ejb-name>
<local-jndi-name>JNDIERLocal</local-jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
Define the ejb-jar.xml the same way.
This will work. I had created an example using Stateless Session bean. It works fine using Weblogic 7.0 and 8.1.
Place the lookup call of EREJB in the business method of PlayerEJB
Seetesh
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 976 times.
Similar Threads
Ant 1.5.2 and ejbjar task
weblogic-ejb-jar.xml
"0 deployed, 9 failed to deploy."
accessing EJB deployed in Weblogic 6.1
calling local bean
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:10:45.