0 Replies Latest reply on Aug 1, 2007 11:40 AM by dalzhim

    @PostConstruct and @PreDestroy never called on JBoss 4.2.1 G

    dalzhim

      While trying to completely undeploy my EJB (see this topic: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=114251 ) I decided to try and track the creation and the destruction of my EJB3 Stateless Bean.

      In order to do so, I implemented my methods the following way:

      @PostConstruct
      public void postConstruct() {
       logger.info("PostConstruct, MonitoringEngineBean is alive.");
      }
      
      @PreDestroy
      public void preDestroy() {
       logger.info("PreDestroy, we release the LogFactory.");
       LogFactory.release(MonitoringEngineBean.class.getClassLoader());
      }
      



      I am certain that my log4j configurations are correct because I'm able to get logs elsewhere in my application, but I was wondering what could prevent the @PostConstruct and @PreDestroy annotated methods from executing.


      Thanks!