[jboss-user] [EJB 3.0] - PostContruct not being called

mohitanchlia do-not-reply at jboss.com
Thu Nov 6 20:29:24 EST 2008


Using jboss 4.2. I have a simple Bean
but when I deploy it in jboss PostConstruct doesn't get called. Is that a bug? I can see that Bean in started state in JMX console though

---

  | @Stateless
  | @Local
  | @LocalBinding (jndiBinding="queue/monitor")
  | public class QueueMonitorTimerServiceBean implements QueueMonitorTimerService{
  | 
  |     @Resource
  |     javax.ejb.TimerService timerService;    
  |     List<BlockingRule> blockingRules = null;
  |     private static final int REFERSH_TIMEOUT = 30 * 1000;
  |     private static final Log logger = LogFactory.getLog(QueueMonitorTimerServiceBean.class);
  | 
  |     @PostConstruct
  |     public void postConstruct(){
  |         logger.info(" Initializing Queue Monitor Timer Service ");
  |         System.out.println("INIT QUEUE ");
  |         Timer timer = timerService.createTimer(REFERSH_TIMEOUT , "Blocking Rule Timer");
  |     }
  |     
  |     public List<BlockingRule> getActiveBlockingRules() {        
  |         // TODO Auto-generated method stub
  |         return blockingRules;
  |     }
  |     
  |     @Timeout
  |     public void timeout(Timer time){
  |         logger.info(" Timeout of Queue Monitor Timer Service ");
  |     }
  | 
  |     public List<BlockingRule> getBlockingRules() {
  |         // TODO Auto-generated method stub
  |         return null;
  |     }
  | }

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

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



More information about the jboss-user mailing list