Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Finding a GSC's MBeanServer connector-coordinates programmatically

Once a GSC is started, I want to connect to it, retrieve MBeans from it and invoke operations on it. But how can I find out it's connection coordinates? For example, it's JMXServiceURL. Would the GSM have the list of all the GSC connectors (of course, then how do I connect to the GSM :-)?



{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2366]{quote}

asked 2008-05-30 13:54:02 -0500

kov gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

Once you will figure out how to get the jmx port you can use this:

If I'm not wrong - you should be able to set a fixed rmi port to be used for the MBean using the space container settings.

There should be a way getting the rmi port from the space container. The com.j_spaces.core.admin.ContainerConfig might be relevant. You can get it from IJSpaceContainerAdmin. getConfig().
Getting the IJSpaceContainerAdmin done from the com.j_spaces.core.cluster.ClusterPolicy
Getting the ClusterPolicy done from the com.j_spaces.core.admin.IRemoteJSpaceAdmin. See its JavaDoc.

In any case, using Guy suggestion to start with 10098 and increase it by one in case you cannot connect - is the simplest one.

In general - The space starts rmi registry (default port is 10098) that is used also by the mbean. So they bind to the same port. If the port is already used , the next one is used etc.


answered 2008-05-30 21:18:27 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Hi Ken,

If you are using the UI, you can luanch a jconsole from the GCS context menu. Deployment tab -> Service Grid Network -> find your GSC -> right client

If you are using the API, the jmx url is stored as an attribute of the jini service.


answered 2008-05-30 14:02:00 -0500

guy sayar gravatar image
edit flag offensive delete link more


Yeah, can already do that thanks. I should have been clearer with my initial post: from within another application I'm writing, how can my code find out how to connect to a running GSC's JMX service?

kov gravatar imagekov ( 2008-05-30 14:11:58 -0500 )edit

Do you have any information about the deployment? If so, the url will awalys be the same (service:jmx:rmi:///jndi/rmi://<ip_address>:10098/jmxrmi), starting with port 10098, and each GSM, GSC will grab the next port.

The url is also kept as an attribute for the jini service, if you want to be dynamic. For that you will need to iterate through the jini services, and lookup the required service. See an example project http://openspaces.org/display/JSB/JiniServiceBrowser


guy sayar gravatar imageguy sayar ( 2008-05-30 14:29:09 -0500 )edit

Hey, thanks. I like the Jini option, I'll look into that.

kov gravatar imagekov ( 2008-05-30 14:30:14 -0500 )edit

I looked at the GS-GUI a bit more, and I'm confused. I brought up the JConsoles for the GSM and GSC and they both apparently have the same connection? I thought each one advertised it's own MBeanServer?

Other info:

I've started up my app and registered for Jini service-discovery of all services, I didn't see any JMX service or proxy there at all.

(edit: Nevermind, I think you meant specifically where the MBean is dynamic which I'm not doing.)

Edited by: Ken Overton on May 30, 2008 3:39 PM

Edited by: Ken Overton on May 30, 2008 3:40 PM

kov gravatar imagekov ( 2008-05-30 15:31:16 -0500 )edit

They use different ports if run on the same machine.

Look at the focal server as well, It exposes all jmx servers http://www.gigaspaces.com/wiki/displa...


guy sayar gravatar imageguy sayar ( 2008-05-30 17:00:23 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2008-05-30 13:54:02 -0500

Seen: 68 times

Last updated: May 30 '08