Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Access the full DTD at <a href="http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd" rel="nofollow">http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd</a> which is very nicely written. All of the tags (elements) are fully described in alphabetical order. Example usage is provided. A minimal ejb-jar.xml file looks like this:</p> <p></p> <p> </p> <pre><code> &lt;!-- A minimal session EJB deployment --&gt; &lt;session&gt; &lt;ejb-name&gt;PostingEJB&lt;/ejb-name&gt; &lt;home&gt;ejbs.PostingHome&lt;/home&gt; &lt;remote&gt;ejbs.Posting&lt;/remote&gt; &lt;ejb-class&gt;ejbs.PostingBean&lt;/ejb-class&gt; &lt;!-- or Stateless --&gt; &lt;session-type&gt;Stateful&lt;/session-type&gt; &lt;transaction-type&gt;Container&lt;/transaction-type&gt; &lt;/session&gt; &lt;!-- A minimal CMP entity EJB deployment --&gt; &lt;entity&gt; &lt;ejb-name&gt;Bid&lt;/ejb-name&gt; &lt;home&gt;ejbe.BidHome&lt;/home&gt; &lt;remote&gt;ejbe.Bid&lt;/remote&gt; &lt;ejb-class&gt;ejbe.BidBean&lt;/ejb-class&gt; &lt;persistence-type&gt;Container&lt;/persistence-type&gt; &lt;prim-key-class&gt;ejbe.BidPK&lt;/prim-key-class&gt; &lt;reentrant&gt;False&lt;/reentrant&gt; &lt;cmp-field&gt;&lt;field-name&gt;bid&lt;/field-name&gt;&lt;/cmp-field&gt; &lt;cmp-field&gt;&lt;field-name&gt;bidder&lt;/field-name&gt;&lt;/cmp-field&gt; &lt;cmp-field&gt;&lt;field-name&gt;bidDate&lt;/field-name&gt;&lt;/cmp-field&gt; &lt;cmp-field&gt;&lt;field-name&gt;id&lt;/field-name&gt;&lt;/cmp-field&gt; &lt;/entity&gt; &lt;!-- A minimal BMP entity EJB deployment --&gt; &lt;entity&gt; &lt;ejb-name&gt;BidBMP&lt;/ejb-name&gt; &lt;home&gt;com.bea.EJBE.solutions.BidBMPHome&lt;/home&gt; &lt;remote&gt;com.bea.EJBE.solutions.BidBMP&lt;/remote&gt; &lt;ejb-class&gt;com.bea.EJBE.solutions.BidBMPBean&lt;/ejb-class&gt; &lt;persistence-type&gt;Bean&lt;/persistence-type&gt; &lt;prim-key-class&gt;pkg.BidBMPPK&lt;/prim-key-class&gt; &lt;reentrant&gt;False&lt;/reentrant&gt; &lt;/entity&gt; </code></pre> <p> </p> <p>Sample for EJB 2</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd"&gt; &lt;ejb-jar&gt; &lt;display-name&gt;EJBModule_Ejemplo&lt;/display-name&gt; &lt;enterprise-beans&gt; &lt;entity&gt; &lt;ejb-name&gt;Track&lt;/ejb-name&gt; &lt;local-home&gt;is346.TrackHome&lt;/local-home&gt; &lt;local&gt;is346.Track&lt;/local&gt; &lt;ejb-class&gt;is346.TrackBean&lt;/ejb-class&gt; &lt;persistence-type&gt;Container&lt;/persistence-type&gt; &lt;prim-key-class&gt;java.lang.Integer&lt;/prim-key-class&gt; &lt;reentrant&gt;False&lt;/reentrant&gt; &lt;cmp-version&gt;2.x&lt;/cmp-version&gt; &lt;abstract-schema-name&gt;Track&lt;/abstract-schema-name&gt; &lt;cmp-field&gt; &lt;field-name&gt;id&lt;/field-name&gt; &lt;/cmp-field&gt; &lt;cmp-field&gt; &lt;field-name&gt;title&lt;/field-name&gt; &lt;/cmp-field&gt; &lt;cmp-field&gt; &lt;field-name&gt;duration&lt;/field-name&gt; &lt;/cmp-field&gt; &lt;primkey-field&gt;id&lt;/primkey-field&gt; &lt;/entity&gt; &lt;entity&gt; &lt;ejb-name&gt;Artist&lt;/ejb-name&gt; &lt;local-home&gt;is346.ArtistHome&lt;/local-home&gt; &lt;local&gt;is346.Artist&lt;/local&gt; &lt;ejb-class&gt;is346.ArtistBean&lt;/ejb-class&gt; &lt;persistence-type&gt;Container&lt;/persistence-type&gt; &lt;prim-key-class&gt;java.lang.Integer&lt;/prim-key-class&gt; &lt;reentrant&gt;False&lt;/reentrant&gt; &lt;cmp-version&gt;2.x&lt;/cmp-version&gt; &lt;abstract-schema-name&gt;Artist&lt;/abstract-schema-name&gt; &lt;cmp-field&gt; &lt;field-name&gt;id&lt;/field-name&gt; &lt;/cmp-field&gt; &lt;cmp-field&gt; &lt;field-name&gt;name&lt;/field-name&gt; &lt;/cmp-field&gt; &lt;primkey-field&gt;id&lt;/primkey-field&gt; &lt;/entity&gt; &lt;session&gt; &lt;ejb-name&gt;TrackSessionFacade&lt;/ejb-name&gt; &lt;home&gt;is346.TrackSessionFacadeHome&lt;/home&gt; &lt;remote&gt;is346.TrackSessionFacade&lt;/remote&gt; &lt;ejb-class&gt;is346.TrackSessionFacadeBean&lt;/ejb-class&gt; &lt;session-type&gt;Stateless&lt;/session-type&gt; &lt;transaction-type&gt;Container&lt;/transaction-type&gt; &lt;ejb-local-ref&gt; &lt;ejb-ref-name&gt;ejb/track&lt;/ejb-ref-name&gt; &lt;ejb-ref-type&gt;Entity&lt;/ejb-ref-type&gt; &lt;local-home&gt;is346.TrackHome&lt;/local-home&gt; &lt;local&gt;is346.Track&lt;/local&gt; &lt;ejb-link&gt;Track&lt;/ejb-link&gt; &lt;/ejb-local-ref&gt; &lt;/session&gt; &lt;session&gt; &lt;ejb-name&gt;ArtistSessionFacade&lt;/ejb-name&gt; &lt;home&gt;is346.ArtistSessionFacadeHome&lt;/home&gt; &lt;remote&gt;is346.ArtistSessionFacade&lt;/remote&gt; &lt;ejb-class&gt;is346.ArtistSessionFacadeBean&lt;/ejb-class&gt; &lt;session-type&gt;Stateless&lt;/session-type&gt; &lt;transaction-type&gt;Container&lt;/transaction-type&gt; &lt;ejb-local-ref&gt; &lt;ejb-ref-name&gt;ejb/artist&lt;/ejb-ref-name&gt; &lt;ejb-ref-type&gt;Entity&lt;/ejb-ref-type&gt; &lt;local-home&gt;is346.ArtistHome&lt;/local-home&gt; &lt;local&gt;is346.Artist&lt;/local&gt; &lt;ejb-link&gt;Artist&lt;/ejb-link&gt; &lt;/ejb-local-ref&gt; &lt;/session&gt; &lt;/enterprise-beans&gt; &lt;relationships&gt; &lt;ejb-relation&gt; &lt;ejb-relation-name&gt;track-artist&lt;/ejb-relation-name&gt; &lt;ejb-relationship-role&gt; &lt;description&gt;track&lt;/description&gt; &lt;ejb-relationship-role-name&gt;TrackRelationshipRole&lt;/ejb-relationship-role-name&gt; &lt;multiplicity&gt;Many&lt;/multiplicity&gt; &lt;relationship-role-source&gt; &lt;description&gt;track&lt;/description&gt; &lt;ejb-name&gt;Track&lt;/ejb-name&gt; &lt;/relationship-role-source&gt; &lt;cmr-field&gt; &lt;description&gt;artist&lt;/description&gt; &lt;cmr-field-name&gt;artist&lt;/cmr-field-name&gt; &lt;cmr-field-type&gt;java.util.Collection&lt;/cmr-field-type&gt; &lt;/cmr-field&gt; &lt;/ejb-relationship-role&gt; &lt;ejb-relationship-role&gt; &lt;description&gt;artist&lt;/description&gt; &lt;ejb-relationship-role-name&gt;ArtistRelationshipRole&lt;/ejb-relationship-role-name&gt; &lt;multiplicity&gt;Many&lt;/multiplicity&gt; &lt;relationship-role-source&gt; &lt;description&gt;artist&lt;/description&gt; &lt;ejb-name&gt;Artist&lt;/ejb-name&gt; &lt;/relationship-role-source&gt; &lt;/ejb-relationship-role&gt; &lt;/ejb-relation&gt; &lt;/relationships&gt; &lt;assembly-descriptor&gt; &lt;container-transaction&gt; &lt;method&gt; &lt;ejb-name&gt;Track&lt;/ejb-name&gt; &lt;method-name&gt;*&lt;/method-name&gt; &lt;/method&gt; &lt;trans-attribute&gt;Required&lt;/trans-attribute&gt; &lt;/container-transaction&gt; &lt;container-transaction&gt; &lt;method&gt; &lt;ejb-name&gt;Artist&lt;/ejb-name&gt; &lt;method-name&gt;*&lt;/method-name&gt; &lt;/method&gt; &lt;trans-attribute&gt;Required&lt;/trans-attribute&gt; &lt;/container-transaction&gt; &lt;container-transaction&gt; &lt;method&gt; &lt;ejb-name&gt;TrackSessionFacade&lt;/ejb-name&gt; &lt;method-name&gt;*&lt;/method-name&gt; &lt;/method&gt; &lt;trans-attribute&gt;Required&lt;/trans-attribute&gt; &lt;/container-transaction&gt; &lt;container-transaction&gt; &lt;method&gt; &lt;ejb-name&gt;ArtistSessionFacade&lt;/ejb-name&gt; &lt;method-name&gt;*&lt;/method-name&gt; &lt;/method&gt; &lt;trans-attribute&gt;Required&lt;/trans-attribute&gt; &lt;/container-transaction&gt; &lt;/assembly-descriptor&gt; &lt;/ejb-jar&gt; </code></pre> <p>Sample for EJB 3.0</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"&gt; &lt;enterprise-beans&gt; &lt;session&gt; &lt;ejb-name&gt;TestBean&lt;/ejb-name&gt; &lt;ejb-ref&gt; &lt;ejb-ref-name&gt;ejb/fooremote&lt;/ejb-ref-name&gt; &lt;ejb-ref-type&gt;Session&lt;/ejb-ref-type&gt; &lt;remote&gt;test.FooRemoteIF&lt;/remote&gt; &lt;/ejb-ref&gt; &lt;env-entry&gt; &lt;description&gt;admin email&lt;/description&gt; &lt;env-entry-name&gt;adminEmail&lt;/env-entry-name&gt; &lt;env-entry-value&gt;admin@example.x&lt;/env-entry-value&gt; &lt;/env-entry&gt; &lt;/session&gt; &lt;/enterprise-beans&gt; &lt;interceptors&gt; &lt;interceptor&gt; &lt;interceptor-class&gt;test.Interceptor1&lt;/interceptor-class&gt; &lt;/interceptor&gt; &lt;/interceptors&gt; &lt;assembly-descriptor&gt; &lt;interceptor-binding&gt; &lt;ejb-name&gt;*&lt;/ejb-name&gt; &lt;interceptor-class&gt;test.Interceptor1&lt;/interceptor-class&gt; &lt;/interceptor-binding&gt; &lt;/assembly-descriptor&gt; &lt;/ejb-jar&gt; </code></pre> <p>Also Some Client implementation are providing own configuration for the same. e.g. Weblogic need to have weblogic-ejb-jar.xml Deployment Descriptor Reference. For more help for web logic can see : <a href="http://docs.oracle.com/cd/E13222_01/wls/docs81/ejb/DDreference-ejb-jar.html" rel="nofollow">http://docs.oracle.com/cd/E13222_01/wls/docs81/ejb/DDreference-ejb-jar.html</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload