Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JMX + RMIConnector

 
Akhil Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
InitialContext ic;
RMIAdaptor connection = null;
Properties prop= new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
prop.put(Context.PROVIDER_URL,"jnp://20.20.83.251:9100");
prop.put(Context.URL_PKG_PREFIXES, "org.jboss.naming rg.jnp.interfaces");
try {
ic = new InitialContext(prop);
connection = (RMIAdaptor) ic.lookup("jmx/rmi/RMIAdaptor");
System.out.println("MBeanServer Connected at :" + connection);
} catch (NamingException e) {
e.printStackTrace();
}


I am using following code in the Client which is running on SUN's JVM and trying to use the Admin Service running on WebSphere Application Server 6.0 using JMX API.

but i am not able to do the lookup .
i have changed the setting on WAS 6.0 to use RMICOnnector not SOAP Connector.

I couldn't find the port listing which needs to be used for RMI COnnection, so i took the ORB_LISTENER_PORT.

when i am using SOAPCOnnector and and using IBM specific client i am able to use the Mbean on WAS 6.0, but dont know how to do that with SUN client

so basically i have two questions:

1. How can i use SOAPCOnnector in a client using SUN JVM to access MBean on WAS 6.0 ?

2. How can i use RMICOnnector in a client using SUN JVM to access MBean on WAS 6.0 ?

and please also suggest which all jars i need to use to run my sun client properly with JMX APIs
 
Akhil Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now its working, but the MBean i am trying to look is not getting looked up. it says the Mbean is not registered.

whereas i have used the same Mbean to do various things using IBM Client.

can anyone help?
 
Henry Wong
author
Sheriff
Posts: 22542
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The example that you provided looks like you are going to the JNDI service for JBoss. Are you sure that you are connecting to Websphere?

Henry
 
Akhil Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am not sure where is it getting connected but i am getting a connection object back and Mbean count which much much more than which i got using IBM client.

I too had this suspicious thinking that i am getting connected to JBoss, but if that is the case, then my JBoss Server is stopped and not running.

Could you suggest what to do?
 
Akhil Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what i am getting when i am using this code,and my JBoss is not running

JVM Vendor:--Sun Microsystems Inc.
MBean Server Connected at:--org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy@337d0f
MBeanServer Count :552
 
Henry Wong
author
Sheriff
Posts: 22542
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My question here is... Where did you get the code snippet for the JNDI call? I just did a search on the IBM site, and their JNDI parameters are completely different.

BTW, I also dug up one of my old JBoss projects, from CVS. And your code is exactly the same as mine -- which I got from the JBoss site.

Henry
 
Akhil Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From somewhere i got something about client on JBOSS, but it doesn't say anything about connecting to IBM.
and that is what my question is,that how to connect to Mbeans on WAS from SUN client using RMIConnector/SOAPConnector and do administrative tasks?

please see my another post which describes my problem more clearly
Another Post By Me
 
Henry Wong
author
Sheriff
Posts: 22542
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Akhil Jain:
From somewhere i got something about client on JBOSS, but it doesn't say anything about connecting to IBM.
and that is what my question is,that how to connect to Mbeans on WAS from SUN client using RMIConnector/SOAPConnector and do administrative tasks?

please see my another post which describes my problem more clearly
Another Post By Me


I seriously recommend that you go to the IBM site and search for a JNDI example on how to connect to the mbean server -- don't use the JBoss one, it won't work for WAS.

As for your other question -- I guess I'll take a look...

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!