0 Replies Latest reply on Dec 29, 2002 11:01 PM by e_jehu

    Deployment fails with mysql and compound keys

    e_jehu

      I am using JBoss version 3.2.0beta on RH Linux 8.0, JDK 1.4.1_01 against mySQL version 4.0.4beta, JDBC driver mysql-connector-java-3.0.3-beta-bin.jar

      I have updated the deployment config files,

      jaws.xml
      --------
      <datasource>java:/MySqlDS</datasource>
      <type-mapping>mySQL</type-mapping>


      cmp-jdbc.xml
      ------------
      <datasource>java:/MySqlDS</datasource>
      <datasource-mapping>mySQL</datasource-mapping>

      mysql-service.xml
      -----------------
      is as per the docs example but the connection url, username and password fields have been completed


      JBoss generates the following sql to create a table

      CREATE TABLE langTaxGroup (uoid VARCHAR(250) BINARY NOT NULL, locale VARCHAR(250) BINARY NOT NULL, name VARCHAR(250) BINARY, updateDate DATETIME, userId VARCHAR(250) BINARY, createdOn DATETIME, createdBy VARCHAR(250) BINARY, taxGroup VARCHAR(250) BINARY, CONSTRAINT pk_langTaxGroup PRIMARY KEY (uoid, locale))

      the EJB has a primary key object that uses the uoid and locale. The application deploys and executes correctly against MS SQL2000. I get the following stack trace;

      2002-12-29 22:47:52,332 ERROR [org.jboss.ejb.EntityContainer] Starting failed
      org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable: (java.sql.SQLException: General error: Can't create table './jboss/langTaxGroup.frm' (errno: 140))
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:175)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:84)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:457)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:369)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:198)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:359)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)

      ... snip ....

      Caused by: java.sql.SQLException: General error: Can't create table './jboss/langTaxGroup.frm' (errno: 140)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:935)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1173)
      at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1141)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:2174)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:2095)
      at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1256)
      at org.jboss.resource.adapter.jdbc.local.LocalStatement.executeUpdate(LocalStatement.java:231)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:166)
      ... 87 more

      any thoughts would be much appreciated

      Evan