5 Replies Latest reply on Feb 12, 2003 5:12 AM by Joyce Stack

    HELP Newbie - CMP Deployment + Configuration

    Joyce Stack Newbie

      Hello,

      I have my home and remote interfaces, my entity bean is written with the following for retrieving a datasource

      Context context = (Context)(new InitialContext()).lookup("java:comp/env");
      datasource = (DataSource)context.lookup("jdbc/DefaultDS");
      this.datasource=datasource;

      I want to use the Hypersonic database. I have a table called Customers in there. I am trying to just connect to database and retrieve and do some simple inserts from my client (a servlet).

      This is my ejb-jar.xml file


      <?xml version="1.0"?>
      <!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>
      <enterprise-beans>

      Entity Bean which demonstrates Bean-Managed persistence.
      <ejb-name>CustomerBean</ejb-name>
      examples.CustomerHome
      examples.Customer
      <ejb-class>examples.CustomerBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      False
      <abstract-schema-name>customers</abstract-schema-name>
      <cmp-version>2.x</cmp-version>
      <cmp-field>
      <field-name>CustomerID</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>FirstName</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>LastName</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>ContactName</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>PhoneNumber</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>DOB</field-name>
      </cmp-field>
      <primkey-field>CustomerID</primkey-field>


      </enterprise-beans>
      <assembly-descriptor>
      <container-transaction>

      <ejb-name>CustomerBean</ejb-name>
      <method-intf>Home</method-intf>
      <method-name>*</method-name>


      <ejb-name>CustomerBean</ejb-name>
      <method-intf>Remote</method-intf>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>



      Can someone please tell me what else do I need to deploy a CMP. ? Do I need to place some jars on my classpath? Do I need a jbosscmp-jdbc.xml file? What deployment steps do I need to do once I have my classes written and compiling?

      Thanks for the help