10 Replies Latest reply on Jan 5, 2011 10:58 AM by andrea-b

    EJB 3.1 Timer problems in scheduling recurring task

    andrea-b

      I'm trying to use an EJB 3.1 Timer to schedule a recurring task every 5 minutes.

      I'm using JBOSS 6.0.0.Final.

       

      This is the simple code I have deployed:

       

       

      import javax.ejb.Schedule;
      import javax.ejb.Stateless;
      import javax.ejb.Timeout;
      /**
      * Session Bean implementation class AlerMonitorBean
      */
      @Stateless
      public class AlerMonitorBean {
          /**
           * Default constructor.
           */
          public AlerMonitorBean() {
              // TODO Auto-generated constructor stub
          }
         
          @Schedule(minute="0/5")
          public void GestisciAlert() {
               System.out.println("Gestisti Alert - Tick"+System.currentTimeMillis());
          }
         
          @Timeout
          public void GestisciTimeout(){
               System.out.println("Timeout");

       

      }

      }

       

       

      import javax.ejb.Schedule;

      import javax.ejb.Stateless;

      import javax.ejb.Timeout;

       

      /**

      * Session Bean implementation class AlerMonitorBean

      */

      @Stateless

      public class AlerMonitorBean {

       

          /**

           * Default constructor.

           */

          public AlerMonitorBean() {

              // TODO Auto-generated constructor stub

          }

       

          @Schedule(minute="*/5")

          public void GestisciAlert() {

          System.out.println("Gestisti Alert - Tick -> "+System.currentTimeMillis());

              //TODO: insert code

          }   

      }

       

       

      I notice the following in Jboss Console:

       

      15:40:00,006 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238400006

      15:40:00,010 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238400010

      15:40:01,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238401004

      15:40:02,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238402004

      15:40:03,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238403004

      15:40:04,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238404004

      15:40:05,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238405004

      15:40:06,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238406004

      15:40:07,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238407004

      15:40:08,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238408003

      15:40:09,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238409004

      15:40:10,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238410003

      15:40:11,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238411004

      15:40:12,006 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238412006

      15:40:13,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238413004

      15:40:14,008 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238414008

      15:40:15,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238415004

      15:40:16,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238416004

      15:40:17,008 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238417008

      15:40:18,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238418004

      15:40:19,003 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238419003

      15:40:20,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238420004

      15:40:21,003 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238421003

      15:40:22,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238422004

      15:40:23,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238423003

      15:40:24,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238424004

      15:40:25,003 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238425003

      15:40:26,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238426004

      15:40:27,003 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238427003

      15:40:28,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238428004

      15:40:29,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238429004

      15:40:30,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238430004

      15:40:31,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238431004

      15:40:32,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238432004

      15:40:33,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238433004

      15:40:34,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238434004

      15:40:35,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238435004

      15:40:36,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238436004

      15:40:37,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238437004

      15:40:38,005 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238438005

      15:40:39,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238439004

      15:40:40,003 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238440003

      15:40:41,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238441004

      15:40:42,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238442004

      15:40:43,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238443004

      15:40:44,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238444004

      15:40:45,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238445004

      15:40:46,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238446004

      15:40:47,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238447004

      15:40:48,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238448004

      15:40:49,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238449004

      15:40:50,003 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238450003

      15:40:51,003 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238451003

      15:40:52,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238452004

      15:40:53,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238453004

      15:40:54,003 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238454003

      15:40:55,008 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238455008

      15:40:56,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238456004

      15:40:57,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238457003

      15:40:58,004 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238458004

      15:40:59,003 INFO  [STDOUT] Gestisti Alert - Tick -> 1294238459003

       

      I expected that method "GestisciAlert" was called once every 5 minutes.....

       

      Every 5 minutes Timer starts and activates target method several times (about once per second) for a minute....

      Then it stops and starts again after 4 minutes.

       

      Hope someone can help me.

       

      Andrea

        • 1. Re: EJB 3.1 Timer problems in scheduling recurring task
          jaikiran

          The syntax you are using is correct. So it should have fired once every 5 minutes. Can you try this - change that timeout method to:

           

          @Schedule(minute="*/5")
              public void GestisciAlert(javax.ejb.Timer timer) {
                System.out.println("Gestisti  Alert for timer: " + timer + " - Tick -> "+System.currentTimeMillis());
              }   
          

           

          And post that output.

          • 2. Re: EJB 3.1 Timer problems in scheduling recurring task
            andrea-b

            I obtain the following error:

             

            ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=jboss.j2ee:ear=SoaEAR.ear,jar=SoaTimerEJB.jar,name=AlerMonitorBean,service=EJB3 state=Create: java.lang.IllegalStateException: Could not find timeout method: soa.schedule.AlerMonitorBean.GestisciAlert()

            • 3. Re: EJB 3.1 Timer problems in scheduling recurring task
              jaikiran

              That's strange. Can you post the entire exception stacktrace?

              • 4. Re: EJB 3.1 Timer problems in scheduling recurring task
                jaikiran

                I think I know what the problem is. There was a thread here which discussed something similar. Basically, the @Schedule by default creates a persistent timer. The @Schedule is expected to create an auto-timer on deployment of the bean. But ideally, it should not create the auto timer for an already persisted timer (or it should clear off the previous instance). I think there was a JIRA for this one, which I probably missed for 6.0 Final. Let me find that thread first.

                 

                For now, delete the JBOSS_HOME/server/<servername>/data folder and as a workaround, use:

                 

                @Schedule(minute="*/5", persistent="false")

                That should get you past these issues.

                • 5. Re: EJB 3.1 Timer problems in scheduling recurring task
                  andrea-b

                  16:15:18,352 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=jboss.j2ee:ear=SoaEAR.ear,jar=SoaTimerEJB.jar,name=AlerMonitorBean,service=EJB3 state=Create: java.lang.IllegalStateException: Could not find timeout method: soa.schedule.AlerMonitorBean.GestisciAlert()
                  at org.jboss.ejb3.timerservice.mk2.CalendarTimer.<init>(CalendarTimer.java:152) [:1.0.0-alpha-13]
                  at org.jboss.ejb3.timerservice.mk2.TimerServiceImpl.getActiveTimers(TimerServiceImpl.java:997) [:1.0.0-alpha-13]
                  at org.jboss.ejb3.timerservice.mk2.TimerServiceImpl.restoreTimers(TimerServiceImpl.java:738) [:1.0.0-alpha-13]
                  at org.jboss.ejb3.timerservice.mk2.TimerServiceFactoryImpl.restoreTimerService(TimerServiceFactoryImpl.java:123) [:1.0.0-alpha-13]
                  at org.jboss.ejb3.TimerServiceContainer.restoreTimerService(TimerServiceContainer.java:244) [:1.7.17]
                  at org.jboss.ejb3.TimerServiceContainer.afterStart(TimerServiceContainer.java:129) [:1.7.17]
                  at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:1113) [:1.7.17]
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]
                  at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]
                  at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.0.GA]
                  at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.0.GA]
                  at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) [jboss-reflect.jar:2.2.0.GA]
                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.GA]
                  at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.GA]
                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.GA]
                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.GA]
                  at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202) [jboss-kernel.jar:2.2.0.GA]
                  at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]
                  at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:894) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:641) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:182) [:2.2.0.GA]
                  at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.GA]
                  at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.GA]
                  at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]
                  at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571) [:2.2.0.GA]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) [:2.2.0.GA]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]
                  at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]
                  at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]
                  at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
                  at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]
                  at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]
                  at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]
                  at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
                  at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]
                  at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]
                  at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]
                  at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]
                  at org.jboss.profileservice.AbstractProfileService.activateProfile(AbstractProfileService.java:154) [:0.2.2]
                  at org.jboss.system.tools.ProfileServiceToolsFacade.addURI(ProfileServiceToolsFacade.java:233) [:6.0.0.Final]
                  at org.jboss.system.tools.LegacyDeploymentScannerAdapter.addURL(LegacyDeploymentScannerAdapter.java:140) [:6.0.0.Final]
                  at org.jboss.system.tools.DeploymentScanner.addURL(DeploymentScanner.java:91) [:6.0.0.Final]
                  at org.jboss.system.tools.DeploymentScanner.addURL(DeploymentScanner.java:83) [:6.0.0.Final]
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]
                  at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) [:6.0.0.GA]
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) [:6.0.0.GA]
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) [:6.0.0.GA]
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271) [:6.0.0.GA]
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670) [:6.0.0.GA]
                  at org.jboss.system.server.jmx.MBeanServerWrapper.invoke(MBeanServerWrapper.java:138) [:6.0.0.Final (Build SVNTag:JBoss_6.0.0.Final date: 20101228)]
                  at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427) [:1.6.0_22]
                  at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72) [:1.6.0_22]
                  at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265) [:1.6.0_22]
                  at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360) [:1.6.0_22]
                  at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788) [:1.6.0_22]
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]
                  at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]
                  at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305) [:1.6.0_22]
                  at sun.rmi.transport.Transport$1.run(Transport.java:159) [:1.6.0_22]
                  at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_22]
                  at sun.rmi.transport.Transport.serviceCall(Transport.java:155) [:1.6.0_22]
                  at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) [:1.6.0_22]
                  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) [:1.6.0_22]
                  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) [:1.6.0_22]
                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_22]
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_22]

                  at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]

                   

                   

                  16:15:18,352 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=jboss.j2ee:ear=SoaEAR.ear,jar=SoaTimerEJB.jar,name=AlerMonitorBean,service=EJB3 state=Create: java.lang.IllegalStateException: Could not find timeout method: soa.schedule.AlerMonitorBean.GestisciAlert()

                  at org.jboss.ejb3.timerservice.mk2.CalendarTimer.<init>(CalendarTimer.java:152) [:1.0.0-alpha-13]

                  at org.jboss.ejb3.timerservice.mk2.TimerServiceImpl.getActiveTimers(TimerServiceImpl.java:997) [:1.0.0-alpha-13]

                  at org.jboss.ejb3.timerservice.mk2.TimerServiceImpl.restoreTimers(TimerServiceImpl.java:738) [:1.0.0-alpha-13]

                  at org.jboss.ejb3.timerservice.mk2.TimerServiceFactoryImpl.restoreTimerService(TimerServiceFactoryImpl.java:123) [:1.0.0-alpha-13]

                  at org.jboss.ejb3.TimerServiceContainer.restoreTimerService(TimerServiceContainer.java:244) [:1.7.17]

                  at org.jboss.ejb3.TimerServiceContainer.afterStart(TimerServiceContainer.java:129) [:1.7.17]

                  at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:1113) [:1.7.17]

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]

                  at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]

                  at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.0.GA]

                  at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.0.GA]

                  at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) [jboss-reflect.jar:2.2.0.GA]

                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.GA]

                  at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.GA]

                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.GA]

                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.GA]

                  at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202) [jboss-kernel.jar:2.2.0.GA]

                  at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]

                  at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:894) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:641) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:182) [:2.2.0.GA]

                  at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.GA]

                  at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.GA]

                  at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]

                  at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]

                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]

                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]

                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571) [:2.2.0.GA]

                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) [:2.2.0.GA]

                  at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]

                  at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]

                  at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]

                  at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]

                  at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]

                  at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]

                  at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]

                  at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]

                  at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]

                  at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]

                  at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]

                  at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]

                  at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]

                  at org.jboss.profileservice.AbstractProfileService.activateProfile(AbstractProfileService.java:154) [:0.2.2]

                  at org.jboss.system.tools.ProfileServiceToolsFacade.addURI(ProfileServiceToolsFacade.java:233) [:6.0.0.Final]

                  at org.jboss.system.tools.LegacyDeploymentScannerAdapter.addURL(LegacyDeploymentScannerAdapter.java:140) [:6.0.0.Final]

                  at org.jboss.system.tools.DeploymentScanner.addURL(DeploymentScanner.java:91) [:6.0.0.Final]

                  at org.jboss.system.tools.DeploymentScanner.addURL(DeploymentScanner.java:83) [:6.0.0.Final]

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]

                  at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]

                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) [:6.0.0.GA]

                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) [:6.0.0.GA]

                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) [:6.0.0.GA]

                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271) [:6.0.0.GA]

                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670) [:6.0.0.GA]

                  at org.jboss.system.server.jmx.MBeanServerWrapper.invoke(MBeanServerWrapper.java:138) [:6.0.0.Final (Build SVNTag:JBoss_6.0.0.Final date: 20101228)]

                  at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427) [:1.6.0_22]

                  at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72) [:1.6.0_22]

                  at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265) [:1.6.0_22]

                  at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360) [:1.6.0_22]

                  at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788) [:1.6.0_22]

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]

                  at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]

                  at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305) [:1.6.0_22]

                  at sun.rmi.transport.Transport$1.run(Transport.java:159) [:1.6.0_22]

                  at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_22]

                  at sun.rmi.transport.Transport.serviceCall(Transport.java:155) [:1.6.0_22]

                  at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) [:1.6.0_22]

                  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) [:1.6.0_22]

                  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) [:1.6.0_22]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_22]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_22]

                  at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]

                  • 6. Re: EJB 3.1 Timer problems in scheduling recurring task
                    jaikiran

                    jaikiran pai wrote:

                     

                    I think I know what the problem is. There was a thread here which discussed something similar.

                    ...

                    I think there was a JIRA for this one, which I probably missed for 6.0 Final. Let me find that thread first.

                     

                    Aaaahhhh! unfortunately, this never made it to the JIRA http://community.jboss.org/message/562006#562006

                    • 7. Re: EJB 3.1 Timer problems in scheduling recurring task
                      jaikiran
                      • 8. Re: EJB 3.1 Timer problems in scheduling recurring task
                        andrea-b
                        @Schedule(minute="*/5", persistent="false")

                        Applying this workaround the scheduled method never start.

                        • 9. Re: EJB 3.1 Timer problems in scheduling recurring task
                          jaikiran

                          As per EJB3.1 spec, by default the "hour" value is 0. Which means that it will fire every 5 minutes at midnight (when hour == 0 for an hour).

                           

                          What you want is:

                           

                          @Schedule(minute=”*/5”, hour=”*”, persistent="false")
                          • 10. Re: EJB 3.1 Timer problems in scheduling recurring task
                            andrea-b

                            All OK, Thanks