3 Replies Latest reply on Apr 14, 2004 4:30 AM by vla

    EJB deployment problem. Help me please...

    vla

      I have an EJB application (with CMP beans) that works on j2ee (the application is made with Forte4) and I want to move it on Jboss (3.2.3 is the version on witch all the tests where made). The problem is that when the server starts to deploy the .ear it chrashes at a table create EJB-QL string (the datasource url is corect because it manages to create some tables). The table name is 'key', a name witch is reserved on mysql. The error output is the folowing :

      ERROR [EntityContainer] Starting failed org.jboss.deployment.DeploymentException: Error while creating table Key; - nested throwable: (java.sql.SQLException: Syntax error or access violation, message from server: "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 'Key (id VARCHAR(250) BINARY NOT NULL, current INTEGER, CONSTRAI")
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:232)

      I think the problem came from the string where the table name in not inside quotes (mysql specific or at least ansi quotes). Can someone help me?

        • 1. Re: EJB deployment problem. Help me please...
          triathlon98

          In the conf/standardjbosscmp-jdbc.xml file, at the bottom, there is a list of "reserved-words", add the extra reserved words to this list.

          Joachim

          • 2. Re: EJB deployment problem. Help me please...
            vla

            Thanks!
            It creates the table... but now it appears to be another problem... it chrashes at the following EJB-QL string :

            ERROR [EntityContainer] Starting failed org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT DISTINCT Object (u) FROM User AS u WHERE u.name = ?1 AND u.password = ?2'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.TokenMgrError: Lexical error at line 1, column 53. Encountered: " " (32), after : "")

            (note: I have included the word user in the "reserved words")
            Can you give me an advice?

            • 3. Re: EJB deployment problem. Help me please...
              vla

              Sorry about my last question, it was a silly one, but I was so tired that I didn`t saw the bug... The specified error mentioned that afther the table "u." it was a space (0x20) and then the rest of the querry (though I copied it right here because I modified, actualiy deleted, the CR/LF from the debug screen, from the command prompt)
              Sorry again....
              But now I am facing another stupid error : Afther I have mentioned that the words : user, group and key; as reserved by msql and Jboss generated the table names with an X in front of them, at a table that relates the tables user and group, the Jboss throws as colum names the reserved words (with no x in front). The error is :

              ERROR [EntityContainer] Starting failed org.jboss.deployment.DeploymentException: Error while creating table User_groups_Group_users; - nested throwable: (java.sql.SQLException: Syntax error or access violation, message from server: "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 'Group INTEGER NOT NULL, User INTEGER NOT NULL, CONSTRAINT pk_Us")
              at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:232)

              Is there any posibility to prevent Jboss from using the reserved words from the colum names?