4 Replies Latest reply on May 17, 2002 5:07 AM by Starco

    Error : "Invalid column name" for CMP CMR Jboss RC2

    Sreeni Janapati Newbie

      Hi all,

      I am JBoss RC2 with Oracle8 and created 2 entity beans for 2 tables (have primary key and foreign key relationship) and one session bean.

      I am trying to create a row in child table and following error is keep coming. Here is the error from server.log.

      I have no clue, why it is taking "CarnetHeaderEJB_carnetItems" which is not a column of the table in container generated insert statement.

      2002-05-14 12:21:50,015 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.CarnetItemEJB] Executing SQL: INSERT INTO CARNET_ITEM (CARNET_NO, CARNET_ITEM_NO, PRODUCT_CLASS, DESCRIPTION, CARNET_VALUE, CARNET_QUANTITY, UNIT_OF_QUANTITY, CARNET_INITIAL_VALUE, CARNET_INITIAL_QUANTITY, CARNET_TRANSACTION_VALUE, QUANTITY_TEXT, VALUE_TOLERANCE_FACTOR, QUANTITY_TOLERANCE_FACTOR, CARNET_TRANSACTION_QUANTITY, HTS_NO1, HTS_NO2, HTS_NO3, PRODUCT_CLASSIFICATION1, PRODUCT_CLASSIFICATION2, PRODUCT_CLASSIFICATION3, PART_NO, CarnetHeaderEJB_carnetItems) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      2002-05-14 12:21:50,046 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.CarnetItemEJB] Could not create entity
      java.sql.SQLException: ORA-00904: invalid column name

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
      at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
      at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542)
      at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1311)
      at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:738)
      at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1313)
      at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1232)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement.java:1353)
      at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1760)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1805)
      at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:322)
      at org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.executeUpdate(LocalPreparedStatement.java:308)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.insertEntity(JDBCCreateEntityCommand.java:196)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:131)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:444)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:253)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:231)
      at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:579)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1116)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:230)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:176)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:134)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:104)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:227)
      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
      at $Proxy114.create(Unknown Source)
      at com.ocr.itts.manager.FacadeManagerBean.setCarnetItem(FacadeManagerBean.java:287)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:664)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:147)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
      at org.jboss.ejb.Container.invoke(Container.java:706)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:364)
      at java.lang.reflect.Method.invoke(Native Method)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
      at sun.rmi.transport.Transport$1.run(Transport.java:152)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)
      at java.lang.Thread.run(Thread.java:484)

      Here is the EJB Relation part of ejb-jar.xml file.


      <ejb-relation>
      <ejb-relation-name>CarnetHeader-CarnetItem</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>CarnetHeader-has-many-CarnetItem</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>CarnetHeaderEJB</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>carnetItems</cmr-field-name>
      <cmr-field-type>java.util.Set</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>CarnetItem-has-a-CarnetHeader</ejb-relationship-role-name>
      Many
      <relationship-role-source>
      <ejb-name>CarnetItemEJB</ejb-name>
      </relationship-role-source>
      <!--
      <cmr-field>
      <cmr-field-name>carnetHeader</cmr-field-name>
      </cmr-field>
      -->
      </ejb-relationship-role>
      </ejb-relation>



      Please give me an idea where I could be wrong.

      Thanks in advance.
      Sreeni