0 Replies Latest reply on Jan 15, 2004 12:12 AM by chinthakae

    Difficulty in Oracle for CMP with JBoss 3.2..

    chinthakae

      Hi,

      I'm a newbie to JBoss.

      I'm having this small problem in using JBoss for deploying an Entity Bean.

      I want to Deploy an Entity bean in JBoss 3.2.3 and to persist data in an Oracle 9i database. I used the following three files (ejb-jar.xml, jboss-xml and jbosscmp-jdbc.xml) to do this. I put all three files inside the META-INF folder of deployed jar file.

      JBoss deployed this successfully, but it seems that it is not using the jbosscmp-jdbc.xml file I provided. It creates its own database table in my Oracle database, but do not use the name of the table given in the jbosscmp-jdbc.xml file. Further it has created the columnns in the db, on its own. I think this is the problem of jboss not using my jbosscmp-jdbc.xml file.

      (I changed the standardjbosscmp-jdbc.xml file so that JBoss uses my db. I do not have problem of JBoss not accessing my db)

      Can someone please please help me on this.

      Thankx in advance !!!



      ********************************************************
      <ejb-jar>
      TestEJB
      <display-name>TestEJB</display-name>
      <enterprise-beans>

      <ejb-name>TaxEJB</ejb-name>
      com.ec.ejb.entitybean.TaxHome
      com.ec.ejb.entitybean.Tax
      <ejb-class>com.ec.ejb.entitybean.TaxEJB</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      False
      <cmp-field>
      <field-name>stateCode</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>taxRate</field-name>
      </cmp-field>
      <primkey-field>stateCode</primkey-field>

      </enterprise-beans>
      <assembly-descriptor>
      <container-transaction>
      Transaction attributes for 'TaxEJB' methods

      <ejb-name>TaxEJB</ejb-name>
      <method-name>*</method-name>

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

      ********************************************************


      <enterprise-beans>

      <ejb-name>TaxEJB</ejb-name>
      <jndi-name>MyTaxBean</jndi-name>
      <!-- <local-jndi-name>MyTaxBeanLocal</local-jndi-name>-->

      </enterprise-beans>


      ********************************************************
      <jbosscmp-jdbc>


      java:/OracleDS
      <datasource-mapping>Oracle8</datasource-mapping>
      <create-table>false</create-table>
      <remove-table>false</remove-table>


      <enterprise-beans>

      <ejb-name>TaxEJB</ejb-name>
      <table-name>TAX_RATE_T</table-name>

      <cmp-field>
      <field-name>stateCode</field-name>
      <column-name>STATE_CODE</column-name>
      </cmp-field>

      <cmp-field>
      <field-name>taxRate</field-name>
      <column-name>TAX_RATE</column-name>
      </cmp-field>


      </enterprise-beans>

      </jbosscmp-jdbc>