• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to call an ejb from ejb in Weblogic 7

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic