If you're using Ant 1.6.x, you should be able to start JBoss using the exec task. Something like:
<exec dir="/path/to/jboss-3.2.2/bin" executable="bash" spawn="true"> <arg line="run.sh"/> <arg line="-c default"/> </exec>
Stopping it would just be something like so:
<arg line="shutdown.sh"/> <arg line="--server jnp://localhost:1099"/>
You could wait for it to be started by using waitfor task:
<waitfor maxwait="5" maxwaitunit="minute" checkevery="500"> <http url="http://localhost:8080/jmx-console"/> </waitfor>
I would write a custom JSP page that checked to make sure everything you need was up (and return a 500 if not), unless someone knows of a call you could fabricate (like with the get task) to html adaptor to see if the server is 'done' starting.
To look for errors on startup or in log, you're best bet is to find/write a task that greps your logfile for errors.
Sorry - if it wasn't clear, that custom JSP page I referred to would be called by the waitfor/http task instead of jmx-console. Fingers are typing faster than brain....
Thanks, nice and simple, just the way I like it.
The testsuite/build.xml in the latest releases (4.0.1RC1, 3.2.7RC1) illustrates how we start/stop several jboss configurations to test clustering, customization of the tomcat container to use ssl, running jboss with a security manager, etc.