0 Replies Latest reply on Aug 15, 2011 5:59 AM by elico.a

    EJB3 TimerService on JBoss6 final

    elico.a Newbie

      Hi,

       

      I am upgrading from JBoss 4.2.2 to JBoss6_Final and have some unresolved issues that I would appreciate your help.

       

      I have an EJB3 that uses TimerService:

       

      @Startup

      @Singleton

      public class MyClassImpl implements MyClassLocal

      {

          @Resource

          private TimerService timerService;

         

          @PostConstruct

          public void initService()

          {               

              long timeTillNextRun = getTimeTillNextRun();

              timerService.createTimer( timeTillNextRun, 1000*60*60, null );

          }

      }

       

      The problem that the line timerService.createTimer( timeTillNextRun, 1000*60*60, null ); throws NullPointerException, as if the injection didn't work.

       

      Do you might have any idea what goes wrong?

       

      Thanks in advance.

       

      Eli.