1 Reply Latest reply on Nov 3, 2005 8:50 AM by Adrian Brock

    CMP Table creation error

    leonard Newbie

      I am new to ejb's and jboss which really complicates things for me. I am trying to deploy a cmp application but recieve a sql exception.

      Error:
      Caused by: java.sql.SQLException: Unexpected token: ) in statement [CREATE TABLE
      CUSTOMEREJB (name VARCHAR(256), birthdate TIMESTAMP, sssNo VARCHAR(256), addres
      s VARCHAR(256), annualSalary DOUBLE, CONSTRAINT PK_CUSTOMEREJB PRIMARY KEY ()]
      at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
      at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)

      Here is my ejb-jar.xml

      <enterprise-beans>


      This bean represents customer

      <ejb-name>CustomerEJB</ejb-name>
      <abstract-schema-name>customer</abstract-schema-name>
      com.demo.entity.cmp.CustomerHomeRemote
      com.demo.entity.cmp.CustomerRemote
      <ejb-class>com.demo.entity.cmp.CustomerBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <security-identity><use-caller-identity/></security-identity>
      <resource-ref>
      DataSource for Demo Database
      <res-ref-name>jdbc/cmp-demo</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
      <cmp-field>
      <field-name>name</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>birthdate</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>sssNo</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>address</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>annualSalary</field-name>
      </cmp-field>

      <query-method>
      <method-name>findBySssNo</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT ID FROM CUSTOMER WHERE SSS_NO=?</ejb-ql>


      </enterprise-beans>
      </ejb-jar>


      What am I doing wrong?