2 Replies Latest reply on Mar 17, 2002 7:59 AM by billhuangyu

    DeploymentException (Max key length is 500)

    billhuangyu Newbie

      I use mysql with jboss 3.0 beta, when I deployed a package, I have a exception like below, anyone has any idea of this. Thank you in advanced.
      2002-03-16 19:14:14,651 ERROR [org.jboss.ejb.EntityContainer] Exception in service lifecyle operation: start
      org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable is: java.sql.SQLException: Invalid argument value: Specified key was too long. Max key length is 500
      java.sql.SQLException: Invalid argument value: Specified key was too long. Max key length is 500

        • 1. Re: DeploymentException (Max key length is 500)
          David Jencks Master

          Looks pretty clear to me, there's something wrong in the generated create table statement. Probably the sum of lengths of keys in some table you are asking to be auto-generated is more than 500.

          You can:
          explicitly specify sql types for the pk fields so their sum is small enough

          or

          use something reasonable like a single long for a pk.

          In any case, turn on more logging until you see the generated sql statement, then it will become clear what is wrong.

          • 2. Re: DeploymentException (Max key length is 500)
            billhuangyu Newbie

            I am using ejbutils-1.2beta to generate the primary key of the bean, it must be a string, any idea about how to map the sql type to avoid this problem? Furthermore, how to turn on more logging? Is it the parameter "debug" in the jbosscmp-jdbc.xml will turn on more logging?



            Thank you for your reply to my question.