1 Reply Latest reply on Apr 8, 2002 11:20 PM by tallpsmith

    CMP2.0 junit test

    grokita

      When running the CMP2.0 example from documentation I get the following exception. What is the problem?


      19:27:54,904 INFO [Server] JBoss (MX MicroKernel) [3.0.0beta Date:200202210220] Started in 0m:11s:
      367ms
      19:28:01,343 ERROR [LogInterceptor] TransactionRolledbackException, causedBy:
      java.sql.SQLException: Unexpected token: ORDER in statement [SELECT id, quantity, shipped, product F
      ROM LineItemEJB WHERE (order=1)]
      at org.hsqldb.Trace.getError(Trace.java:180)
      at org.hsqldb.Result.<init>(Result.java:175)
      at org.hsqldb.jdbcConnection.executeHSQL(jdbcConnection.java:907)
      at org.hsqldb.jdbcConnection.execute(jdbcConnection.java:718)
      at org.hsqldb.jdbcStatement.fetchResult(jdbcStatement.java:686)
      at org.hsqldb.jdbcStatement.executeQuery(jdbcStatement.java:68)
      at org.hsqldb.jdbcPreparedStatement.executeQuery(jdbcPreparedStatement.java:133)
      at org.jboss.resource.adapter.jdbc.local.PreparedStatementInPool.executeQuery(PreparedStatem
      entInPool.java:862)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.execute(JDBCLoadRelationCommand.ja
      va:96)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadRelation(JDBCStoreManager.java:473)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.load(JDBCCMRFieldBridge.java:837
      )
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.getInstanceValue(JDBCCMRFieldBri
      dge.java:519)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.removeFromRelations(JDBCRemoveEnti
      tyCommand.java:128)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemoveEntityCommand.ja
      va:67)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEntity(JDBCStoreManager.java:459)
      at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceManager.java:512)
      at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:488)
      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.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1104)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.jav
      a:184)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterc
      eptor.java:296)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:189
      )
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:108)
      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:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:475)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.ja
      va:308)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$EntityProxy.invoke(BaseLocalContain
      erInvoker.java:412)
      at $Proxy18.remove(Unknown Source)
      at org.jboss.docs.cmp2.commerce.CommerceTest.deleteAllOrders(CommerceTest.java:182)
      at org.jboss.docs.cmp2.commerce.CommerceTest.setUpEJB(CommerceTest.java:172)
      at net.sourceforge.junitejb.EJBTestRunnerBean.setUpEJB(EJBTestRunnerBean.java:70)
      at net.sourceforge.junitejb.EJBTestRunnerBean.run(EJBTestRunnerBean.java:39)
      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.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta
      iner.java:642)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
      at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:1
      44)
      at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance
      Interceptor.java:77)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:308)
      at org.jboss.ejb.Container.invoke(Container.java:630)
      at org.jboss.mx.interceptor.MBeanTarget.invoke(Unknown Source)
      at org.jboss.mx.interceptor.MBeanInvoker.invoke(Unknown Source)

        • 1. Re: CMP2.0 junit test
          tallpsmith

          ummm, isn't "Order" an SQL reserved word?

          I haven't checked out that example so I am not able to confirm the error, but I am guessing that depending on your DB server it will complain about that (different ones seem to understand that you mean the Order field in that context).

          Bit confusing I admit.