Perhaps it's just the JBAS015874 text being late? Have you compared when the .isDeployed marker files appear in relation to the RUNNING state and the JBAS015874?
No... the line is always the last line. Then all my @Startup singletons are started so the ear is completely ready.
If I check the serverState from one of the singletons the state is already RUNNING while my services and singletons are still starting....
Same as on the ear itself.
I checked it via JConsole on:
and called getServiceStatus
This returns UP as one of the returning properties also while it is still deploying...
Any Idea? maybe different MBean? Or Rest based info call?
Are you using @DependsOn?
No... my singletons normally handle dependencies automatically via @EJB
Can I create a dependsOn on the "ear module" or something "late"?
@DependsOn("WHAT SHOULD GO IN HERE")
public class ServerStateCheckerServiceImpl
Then I can use this late service to do my derived initialization stuff
(it's probably only applicable within a single deployment. and there might also be other, non-singleton-dependecies to consider)
Not sure how people generally handle this, perhaps have all components report to a single (singleton?) place and when the last @PostContruct-initiated report comes in, kick things off?
I'm using JBoss EAP 7.0 and check the state of the server during start up with the two MBeans you mentioned every second.
MBean 1 has the ObjectName("jboss.msc:type=container,name=jboss-as")
and I call the method "getServiceStatus" every second.
MBean 1 is always there and the method returns always "UP". I don't see any other state!
MBean 2 has ObjectName("jboss.as:management-root=server")
and I get the attribute "serverState" every second.
MBean 2 is not always there and I have to catch InstanceNotFoundException around mBeanServer.getAttribute().
After about 1 or 2 seconds the MBean 2 is there and the "serverState" attribute has got the value "starting".
After deployment messages and the message "WFLYSRV0025: EAP 7.0.0.Beta1 (WildFly Core 2.0.3.Final-redhat-1) started in 5669ms - Started 403 of 633 services"
the value of the "serverState" attribute changes to "running".
So MBean 2 does the job for me on JBoss EAP 7.0.