aspose file tools*
The moose likes JBoss/WildFly and the fly likes Is JBoss running? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Is JBoss running?" Watch "Is JBoss running?" New topic
Author

Is JBoss running?

Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 823
What is the easiest way to check to see if JBoss is indeed running? Thanks.

Rob
Venkatraman Kandaswamy
Ranch Hand

Joined: Jul 07, 2004
Posts: 120
Some options

* Hit the url http://localhost:8080 to see if you get a response - most obvious

* You can telnet localhost 8080 and see if it connects

* If you are in *nix you can do a ps -ef | grep java to see if you get any results

* If you are crashdows you can do a tasklist to see if java is running

Enjoy !!


--Venkatraman<br />SCJP 1.4<br /><a href="http://kvrlogs.blogspot.com" target="_blank" rel="nofollow">blog</a>
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 823
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.
Venkatraman Kandaswamy
Ranch Hand

Joined: Jul 07, 2004
Posts: 120
In that case you should try accessing the JMX port that JBoss exposes. There are lot of open source tools : JMX tools available. Heres an example of how to do this : web page
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5837
    
    7

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.


JBoss In Action
Javid Jamae
Author
Ranch Hand

Joined: May 14, 2008
Posts: 198
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.


Author: JBoss in Action, javidjamae.com, @javidjamae on Twitter
Sham Phadtale
Ranch Hand

Joined: Jul 29, 2008
Posts: 75
Is there any way by which java code can know the jboss server is started completely(that is showing message - started in ... sec) or not?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10222
    
166

http://community.jboss.org/wiki/StartupAndDeploymentCheck


[My Blog] [JavaRanch Journal]
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2409
    
  28

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
Sham Phadtale
Ranch Hand

Joined: Jul 29, 2008
Posts: 75
Thanks Jaikiran...
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.


Thanks Jayesh..
For me Jboss is up means there is message on console - "JBoss (Microcontainer) [null] Started in 1m:57s:515ms"

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is JBoss running?