8 Replies Latest reply on May 18, 2004 7:28 AM by kauton

    Invalid Column Name when deploying CMP entity bean on JBoss

    kauton Newbie

      Hi guys,

      I would appreciate it if someone gives me some idea how to resolve the following problem. I am trying to deploy a JAR on JBoss 3.2.3. The JAR contains 3 entity beans with CMP and local interfaces and a session bean. When I try to deploy the JAR, I get the following error:

      org.jboss.deployment.DeploymentException: Error while creating table OECASEEJB; - nested throwable: (java.sql.SQLException: ORA-00904: invalid column name)

      I am using Oracle as a datasource. When I deploy the same JAR using the JBoss built-in Hypersonic as datasource it deploys allright. Any ideas?

      Thanx!

        • 1. Re: Invalid Column Name when deploying CMP entity bean on JB
          sesques Novice

          Hi,

          Need more informations to investigate !

          Are you sure you define properly the datasource-mapping in jbosscmp-jdbc.xml ?

          Pascal

          • 2. Re: Invalid Column Name when deploying CMP entity bean on JB
            kauton Newbie

            Yes, the mapping is ok, because this problem only appears with the first bean. If I create the table for it manually and try to deploy, the other bean's tables are created just fine. I am using Oracle 8.1.7. Here is the jbosscmp-jdbc.xml content:

            <?xml version="1.0" encoding="UTF-8"?>

            <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"
            "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd">

            <jbosscmp-jdbc>


            java:/OracleDS
            <datasource-mapping>Oracle8</datasource-mapping>
            <create-table>true</create-table>
            <remove-table>true</remove-table>

            </jbosscmp-jdbc>

            • 3. Re: Invalid Column Name when deploying CMP entity bean on JB
              sesques Novice

              Post the full error log and the full descriptors.
              Do you define specific column mapping with the faulty column name ?
              Try also to activate additional debug messages:

              Adds

              <category name="org.jboss.ejb.plugins">
               <priority value="TRACE" class="org.jboss.logging.XLevel"/>
              </category>
              


              in Log4j.xml

              Pascal


              • 4. Re: Invalid Column Name when deploying CMP entity bean on JB
                kauton Newbie

                I haven't set any mapping of beans to tables and columns in the jbosscmp-jdbc.xml. So JBoss is the one that is constructing the column names.

                Here is the complete log with debug info:

                2004-05-18 14:01:12,307 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/jboss-3.2.3/server/default/deploy/OEMDB-JBoss.jar
                2004-05-18 14:01:13,989 INFO [org.jboss.ejb.EjbModule] Deploying ActiveCaseEJB
                2004-05-18 14:01:14,380 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Cache policy timer started, tasksTimer=java.util.Timer@5db9eb
                2004-05-18 14:01:14,410 TRACE [org.jboss.ejb.plugins.EntityInstancePool] Constructing
                2004-05-18 14:01:14,470 INFO [org.jboss.ejb.EjbModule] Deploying ProjectDataEJB
                2004-05-18 14:01:14,490 TRACE [org.jboss.ejb.plugins.EntityInstancePool] Constructing
                2004-05-18 14:01:14,490 INFO [org.jboss.ejb.EjbModule] Deploying OECaseEJB
                2004-05-18 14:01:14,520 TRACE [org.jboss.ejb.plugins.EntityInstancePool] Constructing
                2004-05-18 14:01:14,520 INFO [org.jboss.ejb.EjbModule] Deploying TestOEMDBEJB
                2004-05-18 14:01:14,640 TRACE [org.jboss.ejb.plugins.StatefulSessionInstancePool] Constructing
                2004-05-18 14:01:14,670 TRACE [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Constructing
                2004-05-18 14:01:14,670 INFO [org.jboss.ejb.EjbModule] Deploying OECaseManagerServiceEJB
                2004-05-18 14:01:14,700 TRACE [org.jboss.ejb.plugins.StatefulSessionInstancePool] Constructing
                2004-05-18 14:01:14,700 TRACE [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Constructing
                2004-05-18 14:01:14,750 DEBUG [org.jboss.ejb.plugins.EntityInstancePool] Creating
                2004-05-18 14:01:14,750 DEBUG [org.jboss.ejb.plugins.EntityInstancePool] Created
                2004-05-18 14:01:14,780 DEBUG [org.jboss.ejb.plugins.EntityInstancePool] Creating
                2004-05-18 14:01:14,780 DEBUG [org.jboss.ejb.plugins.EntityInstancePool] Created
                2004-05-18 14:01:14,800 DEBUG [org.jboss.ejb.plugins.EntityInstancePool] Creating
                2004-05-18 14:01:14,800 DEBUG [org.jboss.ejb.plugins.EntityInstancePool] Created
                2004-05-18 14:01:14,860 DEBUG [org.jboss.ejb.plugins.StatefulSessionInstancePool] Creating
                2004-05-18 14:01:14,860 DEBUG [org.jboss.ejb.plugins.StatefulSessionInstancePool] Created
                2004-05-18 14:01:14,860 DEBUG [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Creating
                2004-05-18 14:01:14,860 DEBUG [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Storing sessions for 'TestOEMDBEJB' in: C:\jboss-3.2.3\server\default\tmp\sessions\TestOEMDBEJB-dudwe7zg-3
                2004-05-18 14:01:14,860 DEBUG [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Purging all session data in: C:\jboss-3.2.3\server\default\tmp\sessions\TestOEMDBEJB-dudwe7zg-3
                2004-05-18 14:01:14,860 DEBUG [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Created
                2004-05-18 14:01:14,900 DEBUG [org.jboss.ejb.plugins.StatefulSessionInstancePool] Creating
                2004-05-18 14:01:14,900 DEBUG [org.jboss.ejb.plugins.StatefulSessionInstancePool] Created
                2004-05-18 14:01:14,900 DEBUG [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Creating
                2004-05-18 14:01:14,900 DEBUG [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Storing sessions for 'OECaseManagerServiceEJB' in: C:\jboss-3.2.3\server\default\tmp\sessions\OECaseManagerServiceEJB-dudwe80k-4
                2004-05-18 14:01:14,900 DEBUG [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Purging all session data in: C:\jboss-3.2.3\server\default\tmp\sessions\OECaseManagerServiceEJB-dudwe80k-4
                2004-05-18 14:01:14,900 DEBUG [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Created
                2004-05-18 14:01:14,940 DEBUG [org.jboss.ejb.plugins.local.BaseLocalProxyFactory] Bound EJBLocalHome of ActiveCaseEJB to local/ActiveCaseEJB
                2004-05-18 14:01:14,950 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] Starting InvalidableEntityInstanceCache...
                2004-05-18 14:01:14,950 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.ActiveCaseEJB] Initializing CMP plugin for ActiveCaseEJB
                2004-05-18 14:01:15,081 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.ActiveCaseEJB] Loading standardjbosscmp-jdbc.xml : file:/C:/jboss-3.2.3/server/default/conf/standardjbosscmp-jdbc.xml
                2004-05-18 14:01:15,932 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.ActiveCaseEJB] jar:file:/C:/jboss-3.2.3/server/default/tmp/deploy/tmp23125OEMDB-JBoss.jar!/META-INF/jbosscmp-jdbc.xml found. Overriding defaults
                2004-05-18 14:01:20,108 DEBUG [org.jboss.ejb.plugins.EntityInstancePool] Starting
                2004-05-18 14:01:20,108 INFO [org.jboss.ejb.plugins.EntityInstancePool] Started jboss.j2ee:jndiName=local/ActiveCaseEJB,plugin=pool,service=EJB
                2004-05-18 14:01:20,108 INFO [org.jboss.ejb.EntityContainer] Started jboss.j2ee:jndiName=local/ActiveCaseEJB,service=EJB
                2004-05-18 14:01:20,178 DEBUG [org.jboss.ejb.plugins.local.BaseLocalProxyFactory] Bound EJBLocalHome of ProjectDataEJB to local/ProjectDataEJB
                2004-05-18 14:01:20,178 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] Starting InvalidableEntityInstanceCache...
                2004-05-18 14:01:20,178 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.ProjectDataEJB] Initializing CMP plugin for ProjectDataEJB
                2004-05-18 14:01:20,208 DEBUG [org.jboss.ejb.plugins.EntityInstancePool] Starting
                2004-05-18 14:01:20,208 INFO [org.jboss.ejb.plugins.EntityInstancePool] Started jboss.j2ee:jndiName=local/ProjectDataEJB,plugin=pool,service=EJB
                2004-05-18 14:01:20,208 INFO [org.jboss.ejb.EntityContainer] Started jboss.j2ee:jndiName=local/ProjectDataEJB,service=EJB
                2004-05-18 14:01:20,248 DEBUG [org.jboss.ejb.plugins.local.BaseLocalProxyFactory] Bound EJBLocalHome of OECaseEJB to local/OECaseEJB
                2004-05-18 14:01:20,248 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] Starting InvalidableEntityInstanceCache...
                2004-05-18 14:01:20,248 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.OECaseEJB] Initializing CMP plugin for OECaseEJB
                2004-05-18 14:01:21,990 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.OECaseEJB] Insert Entity SQL: INSERT INTO OECASEEJB (id, group, status, name, creator, creationDate, comments, oEAdminData, oEMetaData, salesData, engineeringData, warehouseData, purchasingData) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
                2004-05-18 14:01:21,990 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.OECaseEJB] Entity Exists SQL: SELECT COUNT(*) FROM OECASEEJB WHERE id=?
                2004-05-18 14:01:21,990 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.OECaseEJB] entity-command: [commandName=default,commandClass=class org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand,attributes={}]
                2004-05-18 14:01:22,010 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.OECaseEJB] Remove SQL: DELETE FROM OECASEEJB WHERE id=?
                2004-05-18 14:01:22,271 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.OECaseEJB] Executing SQL: CREATE TABLE OECASEEJB (id VARCHAR2(255) NOT NULL, group VARCHAR2(255), status NUMBER(10) NOT NULL, name VARCHAR2(255), creator VARCHAR2(255), creationDate NUMBER(19) NOT NULL, comments BLOB, oEAdminData BLOB, oEMetaData BLOB, salesData BLOB, engineeringData BLOB, warehouseData BLOB, purchasingData BLOB, CONSTRAINT PK_OECASEEJB PRIMARY KEY (id))
                2004-05-18 14:01:22,291 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.OECaseEJB] Could not create table OECASEEJB
                2004-05-18 14:01:22,311 ERROR [org.jboss.ejb.EntityContainer] Starting failed
                org.jboss.deployment.DeploymentException: Error while creating table OECASEEJB; - nested throwable: (java.sql.SQLException: ORA-00904: invalid column name
                )
                at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:232)
                at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:93)
                at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:484)
                at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:388)
                at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:152)
                at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:342)
                at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
                at sun.reflect.GeneratedMethodAccessor47.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.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
                at $Proxy14.start(Unknown Source)
                at org.jboss.system.ServiceController.start(ServiceController.java:394)
                at sun.reflect.GeneratedMethodAccessor9.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 $Proxy29.start(Unknown Source)
                at org.jboss.ejb.EjbModule.startService(EjbModule.java:331)
                at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
                at sun.reflect.GeneratedMethodAccessor47.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.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
                at $Proxy14.start(Unknown Source)
                at org.jboss.system.ServiceController.start(ServiceController.java:394)
                at sun.reflect.GeneratedMethodAccessor9.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 $Proxy12.start(Unknown Source)
                at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:544)
                at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
                at sun.reflect.GeneratedMethodAccessor42.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:476)
                at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
                at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)
                at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
                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:546)
                at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
                at $Proxy0.start(Unknown Source)
                at org.jboss.system.ServiceController.start(ServiceController.java:394)
                at sun.reflect.GeneratedMethodAccessor9.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 $Proxy4.start(Unknown Source)
                at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
                at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
                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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                at $Proxy5.deploy(Unknown Source)
                at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
                at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
                at org.jboss.Main.boot(Main.java:150)
                at org.jboss.Main$1.run(Main.java:395)
                at java.lang.Thread.run(Thread.java:536)
                Caused by: java.sql.SQLException: ORA-00904: invalid column name

                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:262)
                at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:219)
                ... 87 more
                2004-05-18 14:01:22,892 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:jndiName=local/OECaseEJB,service=EJB

                • 5. Re: Invalid Column Name when deploying CMP entity bean on JB
                  kauton Newbie

                  One more thing, I don't know if it would help. On Oracle 8.1.7 it says "invalid column name", and when I try to deploy using Oracle 9.0.2 it says "invalid identifier". Otherwise the problem is the same.

                  • 6. Re: Invalid Column Name when deploying CMP entity bean on JB
                    sesques Novice

                    Hi,

                    I'm not sure it is the real problem but you should try:

                    This error can occurs when using ORACLE reserved words.
                    In the request:

                    [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.OECaseEJB] Executing SQL: CREATE TABLE OECASEEJB (id VARCHAR2(255) NOT NULL, group VARCHAR2(255), status NUMBER(10) NOT NULL, name VARCHAR2(255), creator VARCHAR2(255), creationDate NUMBER(19) NOT NULL, comments BLOB, oEAdminData BLOB, oEMetaData BLOB, salesData BLOB, engineeringData BLOB, warehouseData BLOB, purchasingData BLOB, CONSTRAINT PK_OECASEEJB PRIMARY KEY (id))
                    


                    group is one of them.
                    Change this column name and pray ;-)

                    Pascal



                    • 7. Re: Invalid Column Name when deploying CMP entity bean on JB
                      kauton Newbie

                      Thank you Pascal, indeed this is the problem and I found it out myself just 5 minutes ago after reviewing the SQL TRACE of my Oracle server and seeing what CREATE TABLE statement causes the problem. I guess you found it out the same way, but it took me more time ;). Thanx a lot anyway!

                      Boyan

                      • 8. Re: Invalid Column Name when deploying CMP entity bean on JB
                        kauton Newbie

                        Oh, now I see that the Create Table statement is also shown in the JBoss log with the debug on. Thanx, that is good to know.