<?xml version="1.0" encoding="UTF-8"?>
<section version="5.0" 
         xmlns="http://docbook.org/ns/docbook" 
         xmlns:xlink="http://www.w3.org/1999/xlink" 
         xmlns:xi="http://www.w3.org/2001/XInclude" 
         xmlns:svg="http://www.w3.org/2000/svg" 
         xmlns:mml="http://www.w3.org/1998/Math/MathML" 
         xmlns:html="http://www.w3.org/1999/xhtml" 
         xmlns:db="http://docbook.org/ns/docbook" 
         xml:lang="en" 
         xml:id="ejb2.packaging">

  <info><title>EJB2 Packaging</title></info>
  
  <section xml:id="ejb2.packaging.Princip"><info><title>Principles</title></info>
    
    <para>
      Enterprise Beans are packaged for deployment in a standard Java programming language Archive file, called an 
      ejb-jar
       file. This file must contain the following:
    </para>
    <variablelist>
      <varlistentry>
        <term>
          The beans' class files
        </term>
        <listitem><para>
          The class files of the remote and home interfaces, of the beans'       implementations, of the beans' primary key classes (if there are any),       and of all necessary classes.
        </para></listitem>
      </varlistentry>
      <varlistentry>
        <term>
          The beans' deployment descriptor
        </term>
        <listitem><para>
          The ejb-jar file must contain the deployment descriptors, which are       made up of:       
          <itemizedlist>
            <listitem><para>
              The standard xml deployment descriptor, in the format defined in           the EJB 2.1 specification. Refer            to 
              <code>
                $JONAS_ROOT/xml/ejb-jar_2_1.xsd
              </code>
              or            
              <link xlink:href="http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
                http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd
              </link>
                         . This deployment descriptor must be stored with the name           
              META-INF/ejb-jar.xml
               in the ejb-jar file.
            </para></listitem>
            <listitem><para>
              The JOnAS-specific XML deployment descriptor in the format           defined in 
              $JONAS_ROOT/xml/jonas-ejb-jar_X_Y.xsd
              . This           JOnAS deployment descriptor must be stored with the name           
              META-INF/jonas-ejb-jar.xml
               in the ejb-jar file.
            </para></listitem>
          </itemizedlist>
        </para></listitem>
      </varlistentry>
    </variablelist>
  </section>
  <section><info><title>Example</title></info>
      
      <para>
        Before building the ejb-jar file of the Account entity bean example, the java source files must be compiled to obtain the class files and the two XML deployment descriptors must be written.
      </para>
      <para>
        Then, the ejb-jar file (OpEB.jar) can be built using the 
        jar
         command:
      </para>
      <screen>
    cd your_bean_class_directory
    mkdir META-INF
    cp .../eb/*.xml META-INF
    jar cvf OpEB.jar sb/*.class META-INF/*.xml
    </screen>
  </section>
</section>