8 Replies Latest reply on Sep 3, 2003 4:15 AM by fredatwork

    MySQL CMP and auto-increment

    alpine Newbie

      I have read every message on this board about autoincrement and haven't found any resolution.


      Note that I have already switched the 3.0 to the 3.2 as one person claimed was a solution.

      Also, I still get this error:
      10:50:54,015 ERROR [XmlFileLoader] XmlFileLoader: File jar:file:/E:/project_apps/jboss-3.2.1_tomcat-4.1.24/ser
      ver/default/tmp/deploy/server/default/deploy/go_links.jar/39.go_links.jar!/META-INF/jbosscmp-jdbc.xml process
      error. Line: 25. Error message: Element type "auto-increment" must be declared.
      10:50:54,031 ERROR [XmlFileLoader] XmlFileLoader: File jar:file:/E:/project_apps/jboss-3.2.1_tomcat-4.1.24/ser
      ver/default/tmp/deploy/server/default/deploy/go_links.jar/39.go_links.jar!/META-INF/jbosscmp-jdbc.xml process
      error. Line: 26. Error message: The content of element type "cmp-field" must match "(field-name,read-only?,rea
      d-time-out?,column-name?,not-null?,((jdbc-type,sql-type)|property+)?)".

      Any ideas?


      Here is my jbosscmp-jdbc.xml file:

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE jbosscmp-jdbc PUBLIC
      "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN"
      "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">

      <jbosscmp-jdbc>


      java:/mySQLDS
      <datasource-mapping>mySQL</datasource-mapping>
      <create-table>true</create-table>
      <remove-table>true</remove-table>


      <enterprise-beans>

      <ejb-name>LinkEJB</ejb-name>
      <table-name>link</table-name>
      <cmp-field>
      <field-name>ID</field-name>
      <column-name>ID</column-name>
      <auto-increment/>
      </cmp-field>
      <cmp-field>
      <field-name>URL</field-name>
      <column-name>URL</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>Description</field-name>
      <column-name>DESCRIPTION</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>Category</field-name>
      <column-name>CATEGORY</column-name>
      </cmp-field>
      <entity-command name="mysql-get-generated-keys"/>

      </enterprise-beans>
      </jbosscmp-jdbc>

      Thanks for any help on this matter.