3 Replies Latest reply on Sep 14, 2002 12:18 PM by dsundstrom

    MySQL CMP filed too big

    chojes

      Hi all.
      I am testing a EJB of Oreilly's "Enterprise Java Bean" book. When I used default database in JBoss, a sample EJB was successful. However after changing database to MySQL I have gotten this error messages. It looks like something related with java.lang.String and database column type.
      Please help.


      email : chojes@hanmail.net

      Depends On Me: org.jboss.deployment.DeploymentException: Error while creating table; - nested throw
      able: (java.sql.SQLException: Invalid argument value: Too big column length for column 'name' (max =
      255). Use BLOB instead)]


      19:39:23,384 WARN [ServiceController] Problem starting service jboss.j2ee:service=EJB,jndiName=Cabi
      nHomeRemote
      org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable: (java.sql.
      SQLException: Invalid argument value: Too big column length for column 'name' (max = 255). Use BLOB
      instead)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:175)

        • 1. Re: MySQL CMP filed too big
          dsundstrom

          I thought the limit for MySQL was 500. Anyway if you modify the java.lang.String mySQL mapping in the standardjbosscmp-jdbc.xml file to VARCHAR(250), it should work.

          • 2. Re: MySQL CMP field too big
            andrika

            I happened to encounter this today. I am also trying CMP with MySQL.

            The solution is to change the type mapping from the default "Hypersonic SQL" to "mySQL."

            My question now is, does anybody know how to use the MySQL AUTO_INCREMENT primary key feature with CMP?

            According to the MySQL website, this can now be done with the new beta version of Connector/J. See http://www.mysql.com/products/connector-j/index.html.

            Regards,

            Andrea

            • 3. Re: MySQL CMP field too big
              dsundstrom

              Support for AUTO_INCREMENT was checked in and then commented out yesterday, because of a build ordering problem. Full support should be available in JBoss 4.0 later next week and it will be back ported to 3.2 after that.