Thanks for the reply. If you go to localhost:8080 would you not get the JBoss configuration page or something related to it? This is disabled on the server I'm trying to test it on. Is there a particular jsp in JBoss that I can try connecting to instead? Thanks.
Be careful about using the JMX port to tell if the server is running. The JNDI port and JMX ports are open long before the HTTP port is available, and if you are running on a slow machine (or your check is running very quickly), HTTP might not be available.
Note that I am assuming that the definition of "the server is up" means "http is ready and available".
By the way, are you looking for a manual way to check is the server is up, or an automated way? If automated, successfully connecting to the http port should be enough to tell it is up - you don't need to ask for anything.
If you are checking from the same machine, you might consider not disabling the administrative apps, but rather just binding them too the loopback address, allowing them to only be accessed when you're physically on the machine.
The solution really depends on what you mean by "Jboss is up"
Do you mean the process has started? Do ps -ef Or ping the JMX port
Do you mean that the web server is up? Ping 8080
Do you mean that your webapp is up? You can always have a healthcheck action/webservice/REST in your webapp that should be available when your webapp is initialized. Try to call that page and when it gives an OK response, your webapp is up
Do you want to check that your webapp can connect to databases/web services/external resources? You can have your healthcheck service to run some self tests and report the result
How can I get output of the command "twiddle get "jboss.system:type=Server" Started" in java code? I want to check the status(server started or not) and accordingly want to take some actions.
Sorry it is java specific question, I will ask it on another thread.
For me Jboss is up means there is message on console - "JBoss (Microcontainer) [null] Started in 1m:57s:515ms"
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop