1 Reply Latest reply on Jan 23, 2003 12:45 PM by Zaphod Beeblebrox

    java.sql.SQLException: ERROR:  ExecReplace: Fail to add nul

    dof Newbie

      Hi everyone,

      I'm hitting a brick wall at the moment with the following error when i try to delete a bean which forms the singular side of a one to many relationship.

      The error is :
      java.rmi.ServerException: Store failed; nested exception is:
      java.sql.SQLException: ERROR: ExecReplace: Fail to add null value in not null attribute module_code

      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreEntityCommand.java:77)
      at org.jboss.ejb.plugins.cmp.CMPStoreManager.storeEntity(CMPStoreManager.java:209)
      at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManager.java:442)
      at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:660)
      at org.jboss.ejb.EntityContainer.synchronizeEntitiesWithinTransaction(EntityContainer.java:153)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemoveEntityCommand.java:71)
      at org.jboss.ejb.plugins.cmp.CMPStoreManager.removeEntity(CMPStoreManager.java:221)
      at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceManager.java:526)
      at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:460)
      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:979)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCReadAheadInterceptor.invoke(JDBCReadAheadInterceptor.java:100)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:134)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:308)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:201)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:132)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:156)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:65)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:131)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:447)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:320)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$EntityProxy.invoke(BaseLocalContainerInvoker.java:449)
      at $Proxy43.remove(Unknown Source)
      at aber.dcs.tests.entityBeans.BigTest.tearDownEJB(BigTest.java:387)


      I've created beans for a many:many relationship with no problem, as well as deleting them. But with this one to many relationship it just won't let me delete the bean.

      My deletion goes along the lines of :

      Collection ass = ModuleX.getAssessments();
      [Iterate through ass calling remove on each object]

      Does anyone have any ideas ? Am i stupid ?

      Using jboss3.0.0alpha and Postgres.

      I'll happily paste / upload code if it may help

      dof.