EAP 7 ManagedScheduledExecutorService throws IllegalStateException when trying to submit during startup

Solution Verified - Updated -

Issue

EJb's init() with ManagedScheduledExecutorService new thread returns IllegalStateException but others do not.

Stack of the error:

15:09:27,299 INFO  [stdout] (EE-ManagedExecutorService-default-Thread-1) Running MES@1647032967298
15:09:27,298 ERROR [org.jboss.as.ee] 
(EE-ManagedScheduledExecutorService-default-Thread-1) WFLYEE0110: Failed
 to run scheduled task: java.lang.IllegalStateException: WFLYEE0111: 
Cannot run scheduled task 
org.demo.web.servlet.CallCountServlet$2@2ef3c389 as container is 
suspended
        at org.jboss.as.ee.concurrent.ControlPointUtils$ControlledScheduledRunnable.run(ControlPointUtils.java:184)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.glassfish.enterprise.concurrent.internal.ManagedFutureTask.run(ManagedFutureTask.java:117)
        at 
org.glassfish.enterprise.concurrent.internal.ManagedScheduledThreadPoolExecutor$ManagedScheduledFutureTask.access$101(ManagedScheduledThreadPoolExecutor.java:360)
        at 
org.glassfish.enterprise.concurrent.internal.ManagedScheduledThreadPoolExecutor$ManagedScheduledFutureTask.run(ManagedScheduledThreadPoolExecutor.java:509)
        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:227)

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content