2 Replies Latest reply on May 21, 2003 8:30 PM by sal ingrilli

    cmp2 deployment error with MySQL

    jeffwallen Newbie

      I Get this error trying to deploy the cmp2 (gangster-cmp2) example. I never tried it with the default DS, but MySQL doesn't like the syntax of the request. The "Gangster" table gets created, and looks fine when viewed from the MySqlCC.

      09:53:25,552 INFO [MainDeployer] Starting deployment of package: file:/C:/JAVA/jboss/jboss-3.0.7_jakarta-tomcat-4.1.24/server/d
      efault/deploy/gangster-cmp2.jar
      09:53:25,763 INFO [EjbModule] Creating
      09:53:25,783 INFO [EjbModule] Deploying OrganizationEJB
      09:53:25,933 INFO [EjbModule] Deploying GangsterEJB
      09:53:25,993 INFO [EjbModule] Deploying JobEJB
      09:53:26,003 INFO [EjbModule] Deploying EJBTestRunnerEJB
      09:53:26,093 INFO [EjbModule] Created
      09:53:26,093 INFO [EjbModule] Starting
      09:53:27,856 INFO [GangsterEJB] Created table 'gangster' successfully.
      09:53:28,136 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=crimeportal/Job,service=EJB
      org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable: (java.sql.SQLException: Syntax error o
      r access violation, message from server: "You have an error in your SQL syntax near 'desc VARCHAR(250) BINARY NOT NULL, the_bos
      s INTEGER, CONSTRAINT pk_organization ' at line 1")
      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.start(EntityContainer.java:376)
      at org.jboss.ejb.Container.invoke(Container.java:782)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:1003)
      at $Proxy4.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:413)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy21.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:404)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:1003)
      at $Proxy4.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:413)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy10.start(Unknown Source)
      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:395)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:814)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:627)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
      at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy3.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:656)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:217)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:230)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:207)
      Caused by: java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax
      near 'desc VARCHAR(250) BINARY NOT NULL, the_boss INTEGER, CONSTRAINT pk_organization ' at line 1"
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1626)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:886)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:945)
      at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:917)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:1841)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:1775)
      at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1309)
      at org.jboss.resource.adapter.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:231)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:166)
      ... 53 more
      09:53:28,376 INFO [EjbModule] Started
      09:53:28,376 INFO [MainDeployer] Deployed package: file:/C:/JAVA/jboss/jboss-3.0.7_jakarta-tomcat-4.1.24/server/default/deploy/
      gangster-cmp2.jar
      09:53:28,396 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean operation 'checkIncompleteDeployments()'
      Cause: Incomplete Deployment listing:
      Packages waiting for a deployer:

      Incompletely deployed packages:

      MBeans waiting for classes:

      MBeans waiting for other MBeans:
      [ObjectName: jboss.j2ee:jndiName=crimeportal/Job,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable: (java.sql.SQLException
      : Syntax error or access violation, message from server: "You have an error in your SQL syntax near 'desc VARCHAR(250) BINARY N
      OT NULL, the_boss INTEGER, CONSTRAINT pk_organization ' at line 1")]

        • 1. Re: cmp2 deployment error with MySQL
          jeffwallen Newbie

          I found the problem, its in the cmp2 jbosscmp-jdbc.xml file. It defines a column called "desc" which is a MySQL reserverd word (short for "Describe")

          • 2. Re: cmp2 deployment error with MySQL
            sal ingrilli Newbie

            DESC is the problem.

            Creating a table with a column called name is fine:
            mysql> create table sal1 (name int);
            Query OK, 0 rows affected (0.00 sec)

            Creating a table with a column called desc is NOT fine.
            mysql> create table sal1 (desc int);
            ERROR 1064: You have an error in your SQL syntax near 'desc int)' at line 1

            This is one of those incompatibilities even an app-server won't save you from without one hack or another.

            In our app we decided not to waste time on this & change our "DESC" columns to "DESCR".

            Maybe the gangster sample should be revised. Post this in the documentation forums if you want...