0 Replies Latest reply on Jul 24, 2018 4:05 AM by dennis_financial.com

    Wildfly 13 - Error using ManagedScheduledExecutorService during startup and shutdown

    dennis_financial.com

      Hi All,

       

      During startup and shutdown of Wildfly 13 I see strange error messages when using a simple bean.

       

      Testclass:

      @Startup

      @Singleton

      public class TestClass {

       

          private static final long INITIAL_DELAY = 0;

          private static final long PERIOD = 100;

       

          @Resource

          private ManagedScheduledExecutorService scheduler;

       

          @PostConstruct

          public void init() {

              this.scheduler.scheduleAtFixedRate( this::invokePeriodically,

                  INITIAL_DELAY, PERIOD,

                  TimeUnit.MILLISECONDS);

          }

       

          public void invokePeriodically() {

              System.out.println( "Timestamp " + LocalTime.now());

          }

      }

       

      Error:

      10:54:51,689 ERROR [org.jboss.as.ee] (EE-ManagedScheduledExecutorService-default-Thread-9) WFLYEE0110: Failed to run scheduled task: java.lang.IllegalStateException: WFLYEE0111: Cannot run scheduled task TestClass$$Lambda$756/2021872879@2d709fcc as container is suspended

          at org.jboss.as.ee.concurrent.ControlPointUtils$ControlledScheduledRunnable.run(ControlPointUtils.java:164)

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)

          at org.glassfish.enterprise.concurrent.internal.ManagedScheduledThreadPoolExecutor$ManagedScheduledFutureTask.access$201(ManagedScheduledThreadPoolExecutor.java:383)

          at org.glassfish.enterprise.concurrent.internal.ManagedScheduledThreadPoolExecutor$ManagedScheduledFutureTask.run(ManagedScheduledThreadPoolExecutor.java:534)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

          at java.lang.Thread.run(Thread.java:748)

          at org.glassfish.enterprise.concurrent.ManagedThreadFactoryImpl$ManagedThread.run(ManagedThreadFactoryImpl.java:250)

          at org.jboss.as.ee.concurrent.service.ElytronManagedThreadFactory$ElytronManagedThread.run(ElytronManagedThreadFactory.java:78)

       

      The server was started by using the following command: ./standalone.sh -c standalone-full.xml

       

      If the server is started using the start mode suspend I see the error continuously: ./standalone.sh -c standalone-full.xml --start-mode=suspend

       

      If anyone could tell be want I'm doing wrong that would be highly appreciated.