0 Replies Latest reply on Jan 28, 2006 2:53 PM by asciola

    Exception thrown when attempting to create table

    asciola

      I've configured jboss 4.0.3SP1 to use mysql (5.0.18) and am using netbeans 5.0 as my IDE.

      I'm attempting to use CMP to have jboss manage my entity beans with mysql and when I try to create a minimal Entity Bean, when deployed, I receive the following error:

      19:51:43,593 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=local/UserInfoBean@10534009,service=EJB
      org.jboss.deployment.DeploymentException: Error while creating table userinfobean; - nested throwable: (com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARCHAR(250) BINARY NOT NULL, CONSTRAINT pk_userinfobean PRIMARY KEY (key))' at line 1)


      I have created a jbosscmp-jdbc.xml file (Is this necessary in addition to the standardjbosscmp-jdbc.xml file if it's using the same datastore?) which looks like this:

      <jbosscmp-jdbc>

      java:/DefaultDS
      <datasource-mapping>mySQL</datasource-mapping>
      <create-table>true</create-table>
      <alter-table>true</alter-table>
      <remove-table>false</remove-table>
      <read-only>false</read-only>
      <read-time-out>300000</read-time-out>
      <row-locking>false</row-locking>
      <pk-constraint>true</pk-constraint>
      <fk-constraint>false</fk-constraint>
      <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
      <read-ahead>
      on-load
      <page-size>1000</page-size>
      <eager-load-group>*</eager-load-group>
      </read-ahead>
      <list-cache-max>1000</list-cache-max>
      <clean-read-ahead-on-load>false</clean-read-ahead-on-load>

      <unknown-pk>
      <key-generator-factory>UUIDKeyGeneratorFactory</key-generator-factory>
      <unknown-pk-class>java.lang.String</unknown-pk-class>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(32)</sql-type>
      </unknown-pk>

      <entity-command name="default"/>
      <ql-compiler>org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLCompiler</ql-compiler>
      <throw-runtime-exceptions>false</throw-runtime-exceptions>

      </jbosscmp-jdbc>

      Are there any suggestions as to what would cause the syntax error? It doesn't appear I'm using any reserved words or anything.

      Thanks!

      Anthony