As per the weblogic ejb documentation:ejb-jar.xml and weblogic-ejb-jar.xml are the deployment descriptor files required one per ejb. My question is how about multiple ejb deployments?Thanks

Questions by hmashruf   answers by hmashruf

Showing Answers 1 - 3 of 3 Answers

Srikanth Varma

  • Oct 22nd, 2006
 

U can mention multiple EJB's in the same Deployment descriptor , using <enterprise-beans> tag in the ejb-jar.xml and <weblogic-enterprise-bean> in the weblogic-ejb-jar.xml. if u have doubts share with me my mail id mvsrikanthvarma@gmail.com

Example: ( for ejb-jar.xml )

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
  <display-name>BestEJBModule</display-name>
  <enterprise-beans>
    <entity>
      <ejb-name>Accounts</ejb-name>
      <local-home>bestprj.AccountsHome</local-home>
      <local>bestprj.Accounts</local>
      <ejb-class>bestprj.AccountsBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      <reentrant>False</reentrant>
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>Accounts</abstract-schema-name>
      <cmp-field>
        <field-name>acno</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>name</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>loc</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>bal</field-name>
      </cmp-field>
      <primkey-field>acno</primkey-field>
      <query>
        <query-method>
          <method-name>ejbSelectByLoc</method-name>
          <method-params>
            <method-param>java.lang.String</method-param>
          </method-params>
        </query-method>
        <result-type-mapping>Local</result-type-mapping>
        <ejb-ql>select o.acno  from Accounts as o where o.loc=?1</ejb-ql>
      </query>
    </entity>
    <session>
      <ejb-name>AccountsSessionFacade</ejb-name>
      <home>bestprj.AccountsSessionFacadeHome</home>
      <remote>bestprj.AccountsSessionFacade</remote>
      <ejb-class>bestprj.AccountsSessionFacadeBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <ejb-local-ref>
        <ejb-ref-name>ejb/accounts</ejb-ref-name>
        <ejb-ref-type>Entity</ejb-ref-type>
        <local-home>bestprj.AccountsHome</local-home>
        <local>bestprj.Accounts</local>
        <ejb-link>Accounts</ejb-link>
      </ejb-local-ref>
    </session>
  </enterprise-beans>
  <assembly-descriptor>
    <container-transaction>
      <method>
        <ejb-name>Accounts</ejb-name>
        <method-name>*</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>AccountsSessionFacade</ejb-name>
        <method-name>*</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
  </assembly-descriptor>
</ejb-jar>

  Was this answer useful?  Yes

sreekant

  • Oct 28th, 2006
 

hi sreekanth

 ur sloution is simply gud

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions