I am getting a java.lang.IllegalStateException: Illegal controller state when the async call is executed. Let's say I have 2 modules (M1,M2) that I start from the same ME. M1 does not have any blocking op, but M2 does. The M1 module completes it's start ok.
But the M2 fails when calling async. The question is, can I do something like that ?
11:00:23,193 INFO [<mypkg>.TestModuleImpl] (Controller Boot Thread) MEModule service started.
11:00:23,194 ERROR [stderr] (Controller Boot Thread) java.lang.IllegalStateException: Illegal controller state
11:00:23,196 ERROR [stderr] (Controller Boot Thread) at org.jboss.msc.service.ServiceControllerImpl$StartContextImpl.asynchronous(ServiceControllerImpl.java:2158)
11:00:23,197 ERROR [stderr] (Controller Boot Thread) at <mypkg>.AbstractModule.startAsync(AbstractModule.java:29) <-- context.asynchronous()
11:00:23,197 ERROR [stderr] (Controller Boot Thread) at <mypkg>l.AsyncTestModuleImpl.start(AsyncTestModuleImpl.java:58)
11:00:23,197 ERROR [stderr] (Controller Boot Thread) at <mypkg>.FrameworkBootstrapService.startModule(FrameworkBootstrapService.java:261)
11:00:23,197 ERROR [stderr] (Controller Boot Thread) at <mypkg>.FrameworkBootstrapService.addModule(FrameworkBootstrapService.java:192)
11:00:23,198 ERROR [stderr] (Controller Boot Thread) at <mypkg>.MEModuleAdd$1.execute(MEModuleAdd.java:62)
11:00:23,198 ERROR [stderr] (Controller Boot Thread) at org.jboss.as.controller.OperationContextImpl.executeStep(OperationContextImpl.java:353)
11:00:23,198 ERROR [stderr] (Controller Boot Thread) at org.jboss.as.controller.OperationContextImpl.doCompleteStep(OperationContextImpl.java:298)
11:00:23,198 ERROR [stderr] (Controller Boot Thread) at org.jboss.as.controller.OperationContextImpl.completeStep(OperationContextImpl.java:223)
11:00:23,198 ERROR [stderr] (Controller Boot Thread) at <mypkg>.MEModuleAdd$1.execute(MEModuleAdd.java:65)