This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes How to retrieve the Jnp or RMi port of JBoss server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "How to retrieve the Jnp or RMi port of JBoss server" Watch "How to retrieve the Jnp or RMi port of JBoss server" New topic
Author

How to retrieve the Jnp or RMi port of JBoss server

amycybs amit
Greenhorn

Joined: Aug 28, 2008
Posts: 3
Hello All,

I am just wondering whether is there any way to retrieve the HOST name, JNP or RMI port where JBoss is running and this app is deployed in the same JBoss.

Regards,
-Amit
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

This kind of information can be found in various MBeans. For example, the jboss.system:type=ServerInfo MBeans has a hostName property, and the jboss:service=Naming MBean has a port property. You can use the jmx-console or twiddle to easily scan the mbeans to see which ones contain the information you want, and then have your code query the appropriate mbean properties.


JBoss In Action
amycybs amit
Greenhorn

Joined: Aug 28, 2008
Posts: 3
Thanks peter,

I could browse through the Mbean attributes but couldnt find a proper method to get Attribute rmiPort's value.

This is what I did:

I used MBean: jboss:service=Naming and got all the attributes like port and rmiPort, but still no idea as how to get the value of these attributes.

Any suggestion?

Thanks for the help.

Amit
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

I guess I do not understand your question. What tool are you using to access the MBeans? JMX Console? Twiddle? JMX Console, for example, shows the attribute name and value.
amycybs amit
Greenhorn

Joined: Aug 28, 2008
Posts: 3
Thanks Peter,

I was writing a JMX client to get these information from the JBoss and was not able to find an proper method in MBean API to get the attribute's value.

I already figured it out and here is the sample:



Thanks for your help.

-Amit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to retrieve the Jnp or RMi port of JBoss server