0 Replies Latest reply on Jul 28, 2015 7:02 AM by kuba.smorag

    JBAS014143 after upgrade to EAP 6.4

    kuba.smorag

      I have recently came across a problem which appeared after upgrading from EAP 6.3.3 GA to 6.4 GA.
      Here's the code illustrating the problem.

      [code]
      import javax.ejb.AccessTimeout;
      import javax.ejb.Asynchronous;
      import javax.ejb.ConcurrencyManagement;
      import javax.ejb.ConcurrencyManagementType;
      import javax.ejb.Lock;
      import javax.ejb.LockType;
      import javax.ejb.Schedule;
      import javax.ejb.Singleton;
      import javax.ejb.TransactionManagement;
      import javax.ejb.TransactionManagementType;

      @Singleton
      @TransactionManagement(TransactionManagementType.BEAN)
      @ConcurrencyManagement(ConcurrencyManagementType.BEAN)
      @AccessTimeout(-1)
      public class TestScheduler {

      @Schedule(second="*/10", minute="*", hour="*", persistent=false, info="TestScheduler")
      @Lock(LockType.READ)
      public void scheduler() {
        long time = System.currentTimeMillis();
        System.out.println("TestScheduler " + time+ " | " + (time/1000L));
        try {
         Thread.sleep(5000);
         System.out.println("I am a scheduler step 1 " + time+ " | " + (time/1000L));
         Thread.sleep(7000);
         System.out.println("I am a scheduler step 2 " + time + " | " + (time/1000L));
        } catch (InterruptedException e) {
         System.out.println( " TestScheduler Exception " +  time+ " | " + (time/1000L));
         e.printStackTrace();
        }
      }
      }
      [/code]

      In previous versions of EAP 6.x the method scheduler() runs every 10th second despite of the previous execution still being in progress.
      Now after upgrading to EAP 6.4 the same code works quite different. It seems like the scheduled task cannot be invoked asynchronously and it logs the warning:

      11:07:00,014 WARN  [org.jboss.as.ejb3] (EJB default - 9) JBAS014143: A previous execution of timer [the-class-name] is still in progress, skipping this overlapping scheduled execution at: [time] as timer state is IN_TIMEOUT

      Please keep in mind that in previous versions of the EAP it DID and DO work asynchronously and it was one the main features of the application. The problem seem to occur in every scheduler similar to the one in the snippet.