2 Replies Latest reply on Nov 13, 2009 12:09 PM by mwx.dennis

    Remove persistent timers

      Hi,

      I'd like to know if there is a best practice for dealing with persistent timers.

      In my EJB3 application I had a session bean which used the TimerService. Later during development I removed the timer service and the corresponding @Timeout marked method. Unfortunately, the timers are executed periodically and so even now the timer is still active even after restart.
      Of course, because I removed the @Timeout method ages ago, there is nothing to call back so I continously get the following error message:

      16:04:21,762 ERROR [TimerImpl] Error invoking ejbTimeout
      javax.ejb.EJBException: No method has been annotated with @Timeout
       at org.jboss.ejb3.service.ServiceContainer.callTimeout(ServiceContainer.java:132)
       at org.jboss.as.ejb3.timerservice.TimedObjectInvokerBridge.callTimeout(TimedObjectInvokerBridge.java:44)
       at org.jboss.ejb.txtimer.TimerImpl$TimerTaskImpl.run(TimerImpl.java:561)
       at java.util.TimerThread.mainLoop(Timer.java:512)
       at java.util.TimerThread.run(Timer.java:462)
      


      I believe this is all correct in terms of the specification but: How can I remove these timers? Do I have to use the EJBTimerService MBean?