1 Reply Latest reply on Jun 5, 2006 9:42 PM by genman

    @Predestroy in MDBs

    georgesberscheid

      Hi,

      I deployed an EJB3 message driven bean on JBoss4.0.4GA which allocated a bunch of resources in the @PostConstruct method.
      I'm wondering how to free those resources again when the MDB is undeployed. I thought @Predestroy would do the job, but that method is never called by the container. The result is, that undeploy-redeploy tries to reallocate the resources that have already been taken by the previous deployment and therefore fails.
      Only workaround is to restart the application server.

      @PreDestroy
      public void die() {
       /* Free a bunch of resources */
      }
      


      Any ideas?
      Thanks