0 Replies Latest reply on Sep 4, 2012 8:58 AM by 563912

    javax.ejb.NoSuchObjectLocalException when removing entitybean

      EJB 2.1

      Hi. I am using the below code to remove a record in the database. But it happens that I get a javax.ejb.NoSuchObjectLocalException.

      Before this code is executed, I load the data from the database and create a list of sealsInfoTO that has to be removed, so I only get sealsInfoTO that exists in the database.
      It all is in the same transaction that is started in a session bean.
      It is not only happening with the seals, but also other objects that goes through likewise code
      Iterator removedIterator = seals.removedIterator();
              while (removedIterator.hasNext()) {
                  sealsInfoTO = (SealsInfoTO) removedIterator.next();
                  if ((sealsId = sealsInfoTO.getSealsId()) != null) {
                      sealsInfoLocal = BeanFactory.getInstance().getSealsInfoLocal(sealsId);
                      try {
                          log.debug("sealsInfoLocal with pk " + sealsId + " has been removed by the client");
                      } catch (RemoveException e) {
                          log.error("Can not remove SealsInfo", e);
                          throw new SystemException("Can not remove SealsInfo", e);
      javax.ejb.NoSuchObjectLocalException: [EJB:010142]Instance of EJB 'SealsInfo' with primary key '183109' does not exist.: javax.ejb.NoSuchEntityException: [EJB:010142]Instance of EJB 'SealsInfo' with primary key '183109' does not exist.
           at dk.steria.exp.midtier.model.declaration.ejb.SealsInfo_tjm27k__WebLogic_CMP_RDBMS.ejbRemove(SealsInfo_tjm27k__WebLogic_CMP_RDBMS.java:2682)
           at weblogic.ejb.container.manager.DBManager.remove(DBManager.java:1661)
           at weblogic.ejb.container.internal.EntityEJBLocalObject.remove(EntityEJBLocalObject.java:129)
           at dk.steria.exp.midtier.model.declaration.ejb.SealsInfo_tjm27k_ELOImpl.remove(SealsInfo_tjm27k_ELOImpl.java:646)
           at dk.steria.exp.midtier.tools.consumer.Process.processSealsInfo(Process.java:382)
           at dk.steria.exp.midtier.tools.consumer.DeclarationConsumer.updateDeclaration(DeclarationConsumer.java:205)
           at dk.steria.exp.midtier.tools.consumer.DeclarationConsumer.updateDeclaration(DeclarationConsumer.java:157)
           at dk.steria.exp.midtier.tools.consumer.DeclarationConsumer.submitDeclaration(DeclarationConsumer.java:1207)
           at dk.steria.exp.midtier.api.declaration.ejb.DeclarationSBBean.submitDeclaration(DeclarationSBBean.java:871)
      Edited by: Kristian Lind on Sep 4, 2012 10:56 AM