0 Replies Latest reply on Nov 13, 2013 3:55 AM by Umar Iqbal

    EJB Timer deployment

    Umar Iqbal Newbie

      Hello I'm using ejb timer for the first time and this is my code below.

       

       

      import javax.ejb.Schedule;

      import javax.ejb.Stateless;

      import javax.ejb.Timer;

       

       

      @Stateless

      public class ScheduleRoutine {

       

       

          /**

           * Default constructor.

           */

          public ScheduleRoutine() {

              // TODO Auto-generated constructor stub

          }

       

          @Schedule(second="*/10", minute="*",hour="*", persistent=false)

          public void scheduledTimeout(final Timer t) {

              System.out.println("@Schedule called at: " + new java.util.Date());   

          }

      }

       

      I followed the tutorial from http://www.adam-bien.com/roller/abien/entry/simplest_possible_ejb_3_16 but however the bean doesn't display some text as it is supposed to.

      Im using Jboss As 7.1.1 and eclipse. THis approach might have been wrong so kindly if someone tell me the problem or how should i deploy this bean to schedule every 10 sec. Thanks