How to use @PostConstruct to create timers in a stateless bean EJB3?
I want to create a timer EJB3 when a stateless bean is created in the pool.
But if I use `@PostConstruct` I get the exception:

`java.lang.IllegalStateException: [EJB:010193]Illegal call to EJBContext method. The bean is in "null" state. It cannot perform 'getting the Timer Service' action(s). Refer to the EJB specification for more details.`

If container calls @PostConstruct, the bean ins't null. So, why I get this exception?


----------
**CODE**

    @Stateless
    public class TestBean implements TestLocal {
    
    	@Resource
    	TimerService timerService;
    
    	@PostConstruct
    	public void startTimer() {
    		if (timerService.getTimers().size() == 0) {
    			timerService.createTimer(1 * 1000, 1 * 1000, null);
    		}
    	}
    
    }


----------
**DETAILS**

I'm using weblogic server 11g.
How to use @PostConstruct to create timers in a stateless bean EJB3?
===

I want to create a timer EJB3 when a stateless bean is created in the pool.
But if I use `@PostConstruct` I get the exception:

`java.lang.IllegalStateException: [EJB:010193]Illegal call to EJBContext method. The bean is in "null" state. It cannot perform 'getting the Timer Service' action(s). Refer to the EJB specification for more details.`

If container calls @PostConstruct, the bean ins't null. So, why I get this exception?


----------
**CODE**

    @Stateless
    public class TestBean implements TestLocal {
    
    	@Resource
    	TimerService timerService;
    
    	@PostConstruct
    	public void startTimer() {
    		if (timerService.getTimers().size() == 0) {
    			timerService.createTimer(1 * 1000, 1 * 1000, null);
    		}
    	}
    
    }


----------
**DETAILS**

I'm using weblogic server 11g.