0 Replies Latest reply on Dec 19, 2002 1:01 PM by andyjeff

    Removal of beans

    andyjeff

      I have a servlet-based web app and need to delete an instance of a bean. So i call

      bean_home.remove(primary_key).

      If I create a bean instance using create within the web app, calling bean_home.remove(primary_key) works fine. If however I use an external client to create the bean instances, it fails with

      java.lang.NullPointerException
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.getEntityEJBLocalObject(BaseLocalContainerInvoker.java:199)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.getEntityLocalCollection(BaseLocalContainerInvoker.java:210)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.RelationSet.toArray(RelationSet.java:246)
      at java.util.ArrayList.(ArrayList.java:132)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.removeFromRelations(JDBCRemoveEntityCommand.java:136)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemoveEntityCommand.java:70)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEntity(JDBCStoreManager.java:635)
      at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceManager.java:542)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.removeEntity(CachedConnectionInterceptor.java:431)
      at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:507)


      I can do a findByPrimaryKey on the bean instances created by the external client, and can view them, yet get this error when I try to remove them.

      I'm clearly missing something

      TIA