JBuilder 2005 Enterprise - Entity Beans deployment error on SunOne 8.1 and MySQL

Abstract: JBuilder 2005 Enterprise - Entity Beans deployment error on SunOne 8.1 and MySQL

Information in this Brief applies to:

  • JBuilder 2005 Enterprise
  • EJB Development

Overview

Entity Beans created on SunOne 8.1 with MySQL deploys with the error:

com.sun.enterprise.deployment.backend.IASDeploymentException: Error while running ejbc -- Fatal Error from EJB Compiler -- JDO74025: JDOCodeGenerator: Caught an Exception validating CMP bean 'A' in application 'TestEJB' module 'TestEJB': JDO72335: If the table a for the bean corresponding to the generated class testejb.ABean_1342895764_JDOState is mapped as the primary table, it must have a primary key.

The same bean deploys on WebLogic 8.1 without any problems.

Solution

The schema generated with MySQL JDBC driver 3.1.6 is different from one generated by 3.0.16. The workaround is to fall back to version 3.0.16 of JDBC driver.