Version 2

    Check if startup was successful

     

    There is an MBean that represents the server itself called "jboss.system:type=Server", with an attributed "Started" that takes the value "true" when the server has booted and tried to deploy all applications.

     

    Immediately after this attribute is set to true, tomcat will start it's connectors to let http requests flow in.

     

     

    1) By the time you can get access to either the central tomcat page (http://localhost:8080/) or any deployed web application (e.g. http://localhost:8080/jmx-console) you know the server is started.

     

    2) If you need programmatic check (e.g. from a script), you can try the same thing in (1) using any utility that can get a web page from the command line (e.g. wget http://localhost:8080).

     

    3) There is also the bin/twiddle utility that comes with jboss and can be used to remotely read MBean attribute values. With the following command you can try to read the server "Started" attribute:

     

    twiddle get "jboss.system:type=Server" Started

     

    When twiddle replies with:

     

    Started=true

     

    You know the server is started.

     

    Now when the server is started, applications can come and go (since they can be hot-deployed / undeployed). I presume the second part of your question is really

     

    Check if deployment was successful

     

    For that you need to look at the MBean called jboss.system:service=MainDeployer. It has operations like "listDeployedModules()" or "listIncompletelyDeployed()". Again, it can be accessed through the jmx-console, or twiddle, or a Java application of yours over the RMIAdapter

     

    (see HowDoIGetRemoteAccessToMyMBean)

     

     

     

    Referenced by: