8 Replies Latest reply on Feb 17, 2012 3:59 AM by nimo22

    Single event timer are not executed

    nimo22

      I have a TimerService with a

       

      timerService.createSingleActionTimer(10000, timerConfig);

       

      which returns exactly the error found here

      http://web.archiveorange.com/archive/v/wr91MylMbwSvtrjvKand

       

       

      When navigating to [JBoss JIRA] (AS7-3094) Single event timer are not executed https://issues.jboss.org/browse/AS7-3094,

      the issue does not exist anymore. However, I use 7.1.0.Beta1b and the bug exists.

       

      According to Spec.  javax.ejb.NoMoreTimeoutsException should only occur,

      if a defined Scheduled Timer has expired, but I define a SingleAction-Timer and not a ScheduleTimer!

       

      Is this a bug or my fault?

        • 1. Re: Single event timer are not executed
          nimo22

          I was searching for a workaround and have tried to use ScheduleTimer which ends at a specific point (to simulate a singleActionTimer):

           

          ScheduleExpression s = new ScheduleExpression();

           

                  Calendar c = Calendar.getInstance();

                  c.setTime(d);

                  s.hour(c.get(Calendar.HOUR_OF_DAY));

                  s.minute(c.get(Calendar.MINUTE));

                  s.second(c.get(Calendar.SECOND));

          //        s.month(c.get(Calendar.MONTH));

          //        s.year(c.get(Calendar.YEAR));

                  s.end(d);

           

          However, it returns the same error as above:

           

          13:31:02,033 ERROR [org.jboss.as.ejb3] (pool-9-thread-1) JBAS014122: Error during retyring timeout for timer: ...  javax.ejb.NoMoreTimeoutsException: JBAS014466: No more timeouts for timer

          • 2. Re: Single event timer are not executed
            nimo22

            When using this (year defaults to "*"):

             

            ScheduleExpression s = new ScheduleExpression();

            Calendar c = Calendar.getInstance();

                    c.setTime(d);

                    s.hour(c.get(Calendar.HOUR_OF_DAY));

                    s.minute(c.get(Calendar.MINUTE));

                    s.second(c.get(Calendar.SECOND));

                    s.month(c.get(Calendar.MONTH));

            //        s.year(c.get(Calendar.YEAR));

            //        s.end(d);

             

            the timer is never invoked, even the "s" is already expired.

             

            When using this (month and year defaults to "*"):

             

            ScheduleExpression s = new ScheduleExpression();

            Calendar c = Calendar.getInstance();

                    c.setTime(d);

                    s.hour(c.get(Calendar.HOUR_OF_DAY));

                    s.minute(c.get(Calendar.MINUTE));

                    s.second(c.get(Calendar.SECOND));

            //    s.month(c.get(Calendar.MONTH));

            //      s.year(c.get(Calendar.YEAR));

            //        s.end(d);

             

             

            the timer is invoked at the specific date. However, it is a cycled timer.

             

             

            So to sum up my questions:

             

            1. Why can I not set year and month to a specific point of time to avoid the cycle?

            2. Why can I not set the end of the scheduled expression without returning a javax.ejb.NoMoreTimeoutsException?

            3. Why can I not use a createSingleActionTimer/createActionTimer?

            • 3. Re: Single event timer are not executed
              jaikiran

              nimo stephan wrote:

               

              I have a TimerService with a

               

              timerService.createSingleActionTimer(10000, timerConfig);

               

              which returns exactly the error found here

              http://web.archiveorange.com/archive/v/wr91MylMbwSvtrjvKand

               

               

              Is this a bug or my fault?

              Please post the entire exception stacktrace that you see. Also try using the latest nightly build (which will soon be 7.1.0.Final) or even 7.1.0.CR1b.

              • 4. Re: Single event timer are not executed
                wdfink

                nimo stephan schrieb:

                 

                When navigating to [JBoss JIRA] (AS7-3094) Single event timer are not executed https://issues.jboss.org/browse/AS7-3094,

                 

                There is no AS7-3094, the link is broken

                 

                If you set ScheduleExpression to the exact time now it might be outdated before you activate it.

                See http://docs.oracle.com/javaee/6/api/javax/ejb/ScheduleExpression.html for details how to use it.

                • 5. Re: Single event timer are not executed
                  nimo22

                  Wolf-Dieter Fink wrote:

                   

                  nimo stephan schrieb:

                   

                  When navigating to [JBoss JIRA] (AS7-3094) Single event timer are not executed https://issues.jboss.org/browse/AS7-3094,

                   

                  There is no AS7-3094, the link is broken

                   

                  If you set ScheduleExpression to the exact time now it might be outdated before you activate it.

                  See http://docs.oracle.com/javaee/6/api/javax/ejb/ScheduleExpression.html for details how to use it.

                   

                  As I mentioned before:

                  https://issues.jboss.org/browse/AS7-3094,the issue does not exist anymore.

                   

                  For ScheduleExpression, as pointed here:

                  c.setTime(d); // I set the date to a date in the future

                   

                  As soon as the future date is comming, exception is thrown.

                  • 6. Re: Single event timer are not executed
                    nimo22
                    • 7. Re: Single event timer are not executed
                      wdfink

                      Hi Nimo,

                       

                      can you please attach your source code example to the case?

                       

                      Wolf

                      • 8. Re: Single event timer are not executed
                        nimo22

                        I have updated to jboss 7.1.Final and the error does not exist anymore!

                         

                        Thank you. The bug is gone;)