2 Replies Latest reply on Sep 20, 2004 7:30 AM by sanjuthomas

    CMP Bean creating object in DefaultDS

    sanjuthomas Newbie

      hi all,

      I am very much new to the EJB, now i have been trying to write a CMP bean, now the problem is, my bean is creating object in DefaultDS, that in in the Hypersonic database rather than my MS-SQL, i have a connection pool named ASSYST-DS in the server for MS-SQL, (JNDI name is ASSYST-DS). now please check out my ejb-jar.xml , jboss.xml and jaws.xml files.

      ejb-jar.xml

      <ejb-jar>
      <enterprise-beans>



      <ejb-name>EntityBean</ejb-name>
      entity.ejb.test.EntityHome
      entity.ejb.test.EntityObject
      <ejb-class>entity.ejb.test.EntityBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>

      <abstract-schema-name>EntityBeanSchema</abstract-schema-name>
      <cmp-field><field-name>empID</field-name></cmp-field>
      <cmp-field><field-name>empName</field-name></cmp-field>
      <cmp-field><field-name>empPhoneNumber</field-name></cmp-field>
      <primkey-field>empID</primkey-field>

      <resource-ref>
      DataSource for the MS-SQL database
      <res-ref-name>jdbc/ASSYST-DS</res-ref-name>
      <res-name>ASSYST-DS</res-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>



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

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

      <trans-attribute>Required</trans-attribute>
      </container-transaction>

      </assembly-descriptor>
      </ejb-jar>

      jboss.xml


      <resource-managers>
      <resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
      <res-name>ASSYST-DS</res-name>
      <res-jndi-name>java:/ASSYST-DS</res-jndi-name>
      </resource-manager>
      </resource-managers>

      <enterprise-beans>

      <ejb-name>EntityBean</ejb-name>
      <jndi-name>EntityBean</jndi-name>
      <resource-ref>
      <res-ref-name>jdbc/ASSYST-DS</res-ref-name>
      <resource-name>ASSYST-DS</resource-name>
      </resource-ref>


      </enterprise-beans>



      jaws.xml


      java:/ASSYST-DS
      <type-mapping></type-mapping>

      <enterprise-beans>

      <ejb-name>EntityBean</ejb-name>
      <create-table>false</create-table>
      <table-name>empdata</table-name>
      <remove-table>false</remove-table>
      <tuned-updates>false</tuned-updates>
      <read-only>false</read-only>
      <time-out>300</time-out>
      <cmp-field>
      <field-name>empID</field-name>
      <column-name>empID</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>empName</field-name>
      <column-name>empName</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>empPhoneNumber</field-name>
      <column-name>empPhoneNumber</column-name>
      </cmp-field>

      </enterprise-beans>



      now the bean is creating in table named ENTITYBEAN in Hypersonic, rather than in my datasource, if somebody know the reason please help me.
      thanx in advance ..

      with regards
      sanju