We are running JBoss application server 4.0.5 ... some services (servlets) are getting started before the server goes into RUNNING state ... which is causing the messages picked up by those services to error out as other needed services are not yet available.

Is there a way to check if the server state is RUNNING from inside the Java program?

Using that check, I could put use a Thread.sleep and check every 10 seconds or so if server is running. This would be in a separate thread so that this itself would not hold up the start of the server.

I know of a way to do this in weblogic ... but I am fairly new to JBoss.