[jboss-user] [EJB 3.0] - @PostConstruct and @PreDestroy never called on JBoss 4.2.1 G

Dalzhim do-not-reply at jboss.com
Wed Aug 1 11:40:36 EDT 2007


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!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069711#4069711

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069711



More information about the jboss-user mailing list