2 Replies Latest reply on Oct 18, 2011 4:25 AM by icey.xiong

    the timer service has beean disabled,please add a <timer-service> entry into the ejb section

    icey.xiong

      Dear all,

            I want to create a timer-service on JBoss As 7.0.here is my work:

       

      @Singleton
      @Local(UserLocal.class)
      @Startup
      public class User implements UserLocal
      {
                @Resource
                TimerService timer;
      
                @Timeout
                public void run(Timer timer)
                {
                         System.out.println("time out!");
                }
                @PostConstruct
                public void scheduleTimer()
                {
                         timer.createTimer(new Date(),1000*1*60,null);
                 }
      }
      

      but when I start up the jboss ,error comes out: java.ejb.EJBException:java.lang.UnsupportedOperationException:the timer service has been disabled.Plealse add a <timer-service> entry into the ejb section of the server configuration to enable it.

       

      I also try to use annotation @Schedule,but it has the same result,inform that timer-service is unenabled.

       

      I guess,there is some place I can configure the timer-service,but I can not find it.I try in standalone.xml and ejb-jar.xml ,but in vains. and there is so little imformation about the configurationg of timer-service. Dear friend, do you know how to solve the problem?  how can I enable the timer-service in jboss as 7.0