I'm running in JBOSS 4.0.1 in a clustered environment. At the moment both 
cluster-instances run on the same machine. 
I registered a mbean in both cluster instances and can see them in the 
jmx-console. The name of the mbean consists of the mbean-name and the cluster 
node. 

name=ConfigurationService,node=jboss1,type=CommonServiceMBean 
name=ConfigurationService,node=jboss2,type=CommonServiceMBean 

These mbeans are responsible for holding configurations for applications. 

I try to access both mbeans from an application inside the cluster.  The 
problem is that the queryMBeans-Method always replies the node1 mbean (see code 
below).

Can anyone help, what is wrong? Maybe there is also a better way to treat with 
this problem.


  | Properties cluster1 = new Properties();
  | cluster1.put(Context.INITIAL_CONTEXT_FACTORY, 
"org.jnp.interfaces.NamingContextFactory");
  | cluster1.put(Context.URL_PKG_PREFIXES, 
"org.jboss.naming:org.jnp.interfaces");
  | cluster1.put(Context.PROVIDER_URL, "jnp://myServer:19201");
  | InitialContext ctx = new InitialContext(cluster1);  
  | 
  | RMIAdaptor mbean = (RMIAdaptor) ctx.lookup("jmx/rmi/RMIAdaptor");
  | ObjectName name = new ObjectName(objectName); 
//???:type=CommonServiceMBean,name=ConfigurationService,*
  | servers=mbean.queryMBeans(name,null);
  | 
  | Properties cluster2 = new Properties();
  | cluster2.put(Context.INITIAL_CONTEXT_FACTORY, 
"org.jnp.interfaces.NamingContextFactory");
  | cluster2.put(Context.URL_PKG_PREFIXES, 
"org.jboss.naming:org.jnp.interfaces");
  | cluster2.put(Context.PROVIDER_URL, "jnp://myServer:19301");
  | InitialContext ctx1 = new InitialContext(cluster2); 
  | 
  | RMIAdaptor mbean2 = (RMIAdaptor) ctx1.lookup("jmx/rmi/RMIAdaptor");
  | servers2=mbean2.queryMBeans(name,null);
  | 



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3868484#3868484

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3868484


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to