0 Replies Latest reply on Oct 25, 2001 4:43 AM by Andri

    Error when accessing CMP

    Andri Newbie

      Hi,

      I experiences problem when accessing a CMP bean (JBoss 2.4.3 + Tomcat and Ms SQL Server 7).
      It comes when I try to invoke its methods, such
      as getXXX, and also when creating new record.
      It seems the problem is related to SQL exception.
      - When using sun Jdbc Odbc driver, I get "Invalid descriptor index"
      - When using FreeTds driver, I get javax.transaction.TransactionRolledbackException: Load failed; nested exception is: java.sql.SQLException: Not implemented;nested exception is: java.rmi.ServerException: Load failed;.........

      My data source config in jboss.jcml:

      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
      ebankPool jdbc:freetds:sqlserver://ntserver:1433/ebank
      dev01
      dev01
      1200000
      10

      false
      false
      false
      true
      120000
      1800000
      false
      false
      1.0
      0


      jaws.xml:
      <default-entity>
      <create-table>false</create-table>
      <remove-table>false</remove-table>
      <tuned-updates>false</tuned-updates>
      <read-only>false</read-only>
      <time-out>300</time-out>
      <select-for-update>false</select-for-update>
      </default-entity>

      <enterprise-beans>

      <ejb-name>Bank</ejb-name>
      <table-name>BANK</table-name>
      <create-table>false</create-table>
      <cmp-field>
      <field-name>id</field-name>
      <column-name>ID</column-name>
      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>INTEGER</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>bankName</field-name>
      <column-name>BANK_NAME</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(50)</sql-type>
      </cmp-field>

      </enterprise-beans>

      ejb-jar.xml:

      <ejb-name>Bank</ejb-name>
      testjboss.BankHome
      testjboss.Bank
      <ejb-class>testjboss.BankBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <cmp-field>
      <field-name>id</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>bankName</field-name>
      </cmp-field>
      <primkey-field>id</primkey-field>
      <resource-ref>
      <res-ref-name>java:/ebankPool</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>


      I get no error when using JDBC directly (get/lookup the datasource, get connection and selecting dan displaying rows). I tested this using JSP (packaged in a war file, and together with the bean jar forms an EAR).
      I've also tried creating a stateless session bean, and it also produces the same error when the bean method access the CMP bean.

      Thanks in advanced,
      Andri

      Another one, is the JBoss monitor workable ?
      There's something missing/wrong in the monitor.jar's manifest file, and I've added the appropriate dependent libraries (jboss-j2ee.jar and log4j), but still couldn't make it work.