0 Replies Latest reply on May 4, 2005 4:08 AM by dirkgf

    How to cleanup after NullPointerException in StatefulSession

    dirkgf

      I've got a stateful session bean which threw a NullPointerException during the development process. The NullPointerException was caused by a programming error in my code.
      As expected I get a RemoteException on the client side. In order to clean up behind of me, I'm calling .remove() on my stateful session bean. However this results in a
      "Could not activate; failed to restore state; CausedByException is:
      /usr/local/jboss/3.2.7/server/default/tmp/sessions/DocumentStreamer-e8b910eu-3/e8b915rl-4.ser (No such file or directory)"

      So it looks like JBoss tried to passivate the EJB but the passivate method was never called (added a System.err.println() to verify this)?

      So how can I clean up behind of me, after an exception has occured on the server. Calling .remove does not seem to work any more. However the EJB seems still to be around on the server, since the Transaction manager is rolling back the opened SQL transaction after the timeout period?

      I'm using JBoss 3.2.7 with JDK 1.4.2_07.