3 Replies Latest reply on Oct 23, 2003 5:56 AM by Allen Schell

    DeploymentException: Error while creating table/Oracle/JBoss

    wilkerd1 Newbie

      All,

      I am trying to deploy a CMP 2.0 bean to JBoss 3.2.2RC4 (DB is Oracle9i and am using XDoclet for interface and descriptor generation) and keep receiving a DeploymentException: Error while creating table [TABLE NAME HERE]....ORA-00936: missing expression.

      I turned on logging for CMP and put it in it's own file to look at the SQL. What I found is that the JBoss generated SQL statement is missing the primary key field specified in the create table's constraint syntax.

      What is missing that will make JBoss insert my "ID" field in those parentheses and create the table?

      I have been struggling with this for quite some time now and have only found one person on the net with a similar problem (in another forum; not jboss.org ) and nobody answerd his plea for help either.

      Any help would be greatly appreciated, and the stack trace from deployment and the SQL information from the CMP log are below!

      Thanks,
      Daniel

      -----------------------------
      Stack Trace:
      -----------------------------
      16:10:07,360 INFO [EntityContainer] Starting
      16:10:07,531 ERROR [EntityContainer] Starting failed
      org.jboss.deployment.DeploymentException: Error while creating table TRAINEECOMPOSITEENTITY; - nested throwable: (java.sql.SQLException: ORA-00936: missing expression
      )
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:231)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:91)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:505)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:411)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:152)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:343)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      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:546)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
      at $Proxy12.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      at sun.reflect.GeneratedMethodAccessor8.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:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy97.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:330)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      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:546)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
      at $Proxy12.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      at sun.reflect.GeneratedMethodAccessor8.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:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy10.start(Unknown Source)
      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:543)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:816)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:632)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at sun.reflect.GeneratedMethodAccessor38.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:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:458)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      Caused by: java.sql.SQLException: ORA-00936: missing expression

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
      at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
      at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
      at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
      at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
      at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
      at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
      at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:796)
      at org.jboss.resource.adapter.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:233)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:218)
      ... 57 more
      16:10:07,541 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=ejb/armp/taip/ejb/TraineeCompositeEntityLocalHome,service=EJB
      org.jboss.deployment.DeploymentException: Error while creating table TRAINEECOMPOSITEENTITY; - nested throwable: (java.sql.SQLException: ORA-00936: missing expression
      )
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:231)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:91)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:505)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:411)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:152)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:343)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      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:546)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
      at $Proxy12.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      at sun.reflect.GeneratedMethodAccessor8.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:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy97.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:330)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      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:546)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
      at $Proxy12.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      at sun.reflect.GeneratedMethodAccessor8.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:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy10.start(Unknown Source)
      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:543)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:816)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:632)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at sun.reflect.GeneratedMethodAccessor38.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:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:458)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      Caused by: java.sql.SQLException: ORA-00936: missing expression

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
      at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
      at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
      at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
      at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
      at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
      at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
      at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:796)
      at org.jboss.resource.adapter.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:233)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:218)
      ... 57 more

      -----------------------------
      CMP Log:
      -----------------------------
      2003-10-20 16:09:19,191 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.TraineeCompositeEntity] Initializing CMP plugin for TraineeCompositeEntity
      2003-10-20 16:09:19,241 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.TraineeCompositeEntity] Loading standardjbosscmp-jdbc.xml : file:/C:/jboss-3.2.2RC4/server/default/conf/standardjbosscmp-jdbc.xml
      2003-10-20 16:09:19,421 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.TraineeCompositeEntity] file:/C:/jboss-3.2.2RC4/server/default/deploy/ARMP_TAIP_EAR.ear/ARMP_TAIP_EJB.jar/META-INF/jbosscmp-jdbc.xml found. Overriding defaults
      2003-10-20 16:09:20,964 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.TraineeCompositeEntity] Insert Entity SQL: INSERT INTO TRAINEECOMPOSITEENTITY(collQuals, SBegDate, SCompositeEntityID, SEndDate) VALUES (?, ?, ?, ?)
      2003-10-20 16:09:20,964 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.TraineeCompositeEntity] Entity Exists SQL: SELECT COUNT(*) FROM TRAINEECOMPOSITEENTITY WHERE
      2003-10-20 16:09:20,964 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.TraineeCompositeEntity] entity-command: [commandName=default,commandClass=class org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand,attributes={}]
      2003-10-20 16:09:20,964 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.TraineeCompositeEntity] Remove SQL: DELETE FROM TRAINEECOMPOSITEENTITY WHERE
      2003-10-20 16:09:21,034 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.TraineeCompositeEntity] Executing SQL: CREATE TABLE TRAINEECOMPOSITEENTITY(collQuals BLOB, SBegDate VARCHAR2(255), SCompositeEntityID VARCHAR2(255), SEndDate VARCHAR2(255), CONSTRAINT PK_TRAINEECOMPOSITEENTITY PRIMARY KEY ())
      2003-10-20 16:09:21,054 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.TraineeCompositeEntity] Could not create table TRAINEECOMPOSITEENTITY

        • 1. Re: DeploymentException: Error while creating table/Oracle/J
          Allen Schell Newbie

          I have had similar table creation problems (using PostgreSQL, not Oracle) and found that the problem was with the XDoclet tags that I was (or wasn't) using. I'd double-check to make sure that you have properly designated the primary key and persistence attributes for fields in your bean code( e.g. @ejb.pk and @ejb.persistence tags) and also see if there are any Oracle specific tags that might me needed.

          -- afschell

          • 2. Re: DeploymentException: Error while creating table/Oracle/J
            wilkerd1 Newbie

            Thanks for the reply, I appreciate it! :)

            What XDoclet tags did you have to use to get a correct deployment in PostgreSQL (class and method level)?

            FYI - I did try to create the table myself and bypass this problem temporarily, however, things got worse: starting gettting a NullPointerException and JBoss was complaining about some other SQL issue. In a nutshell, it didn't work.

            Does anyone have a baseline set of tags that work for JBoss and Oracle (i.e. the bare minimum neccessary to successfully deploy a BMP and CMP Entity)?

            ::BEGIN SOAPBOX::

            I see the value in XDoclet as the number of beans developed increases (and a baseline set of tags have been layed out for the target deployment environment), however, the time it has taken me to successfully deploy an Entity bean is by far longer than what it would have taken me to code it by hand...Unfortunately as with most open source products: great product, crummy docs. :(

            ::END SOAPBOX:: ;)

            -Daniel

            • 3. Re: DeploymentException: Error while creating table/Oracle/J
              Allen Schell Newbie

              The @ejb.persistence and @ejb.interface-method tags. Which ones are you using?

              And to your soapbox...I agree that it's faster to type in the EJB code the first couple of times, but after that forget it. If you're having trouble with the command line interfaces, try eclipse with the ensemble-system's glider plug-in to generate the code.