Problem in getting MBean attributes from a JMX remote client program with Administrative Security on
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Reetesh_Chauhan
Posted On:   Wednesday, February 21, 2007 04:57 AM

Hi, I am new to JMX and WebSphere Application Server 6.1. I am trying to get 'heapSize' attribute from 'JVM' MBean by using the Sample program given at following link: http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tjmx_develop_jsr160.html Following are the jar files in my classpath: 1)com.ibm.ws.admin.client_6.1.0.jar 2)com.ibm.ws.webservices.thinclient_6.1.0.jar 3)ibmorb.jar 4)management.jar 5)pmij2ee.jar My code works perfectly fine if i disable administrative security on Application Server. But when i enable the Administrative Security from Admin console, I can create a c   More>>


Hi,

I am new to JMX and WebSphere Application Server 6.1.

I am trying to get 'heapSize' attribute from 'JVM' MBean by using the Sample program given at following link:

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tjmx_develop_jsr160.html


Following are the jar files in my classpath:
1)com.ibm.ws.admin.client_6.1.0.jar
2)com.ibm.ws.webservices.thinclient_6.1.0.jar
3)ibmorb.jar
4)management.jar
5)pmij2ee.jar


My code works perfectly fine if i disable administrative security on Application Server.

But when i enable the Administrative Security from Admin console, I can create a connection with the Application Server and then Query for the JVM MBean as well. But while calling the getAttribute method for the JVM MBean as shown below:

			

mbsc.getAttribute(mbean,"heapSize");
//mbsc is the MBeanServerConnection object
//mbean represents ObjectName object correponding to JVM MBean



I received following error on above line:
			


javax.management.JMRuntimeException:
>> SERVER (id=4773e3aa, host=01hw107573) TRACE START:
>> javax.management.JMRuntimeException: ADMN0022E: Access is denied for the getStats operation on JVM MBean because of insufficient or empty credentials.
>> at com.ibm.ws.management.AdminServiceImpl.preInvoke(AdminServiceImpl.java:2119)
>> at com.ibm.ws.management.AdminServiceImpl.preInvoke(AdminServiceImpl.java:1766)
>> at com.ibm.ws.management.AdminServiceImpl.preInvoke(AdminServiceImpl.java:1694)
>> at com.ibm.ws.management.AdminServiceImpl.preInvoke(AdminServiceImpl.java:1667)
>> at com.ibm.ws.management.AdminServiceImpl.getAttribute(AdminServiceImpl.java:661)
>> at com.ibm.ws.management.remote.AdminServiceForwarder.getAttribute(AdminServiceForwarder.java:135)
>> at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1400)
>> at javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:96)
>> at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1260)
>> at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1356)
>> at javax.management.remote.rmi.RMIConnectionImpl.getAttribute(RMIConnectionImpl.java:612)
>> at javax.management.remote.rmi._RMIConnectionImpl_Tie.getAttribute(_RMIConnectionImpl_Tie.java:576)
>> at javax.management.remote.rmi._RMIConnectionImpl_Tie._invoke(_RMIConnectionImpl_Tie.java:97)
>> at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:613)
>> at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:466)
>> at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
>> at com.ibm.CORBA.iiop.ORB.process(ORB.java:1552)
>> at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2673)
>> at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2551)
>> at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
>> at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:95)
>> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498)
>> SERVER (id=4773e3aa, host=01hw107573) TRACE END.

at com.ibm.ws.management.AdminServiceImpl.preInvoke(AdminServiceImpl.java:2119)
at com.ibm.ws.management.AdminServiceImpl.preInvoke(AdminServiceImpl.java:1766)
at com.ibm.ws.management.AdminServiceImpl.preInvoke(AdminServiceImpl.java:1694)
at com.ibm.ws.management.AdminServiceImpl.preInvoke(AdminServiceImpl.java:1667)
at com.ibm.ws.management.AdminServiceImpl.getAttribute(AdminServiceImpl.java:661)
at com.ibm.ws.management.remote.AdminServiceForwarder.getAttribute(AdminServiceForwarder.java:135)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1400)
at javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:96)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1260)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1356)
at javax.management.remote.rmi.RMIConnectionImpl.getAttribute(RMIConnectionImpl.java:612)
at javax.management.remote.rmi._RMIConnectionImpl_Tie.getAttribute(_RMIConnectionImpl_Tie.java:576)
at javax.management.remote.rmi._RMIConnectionImpl_Tie._invoke(_RMIConnectionImpl_Tie.java:97)
at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:613)
at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:466)
at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:1552)
at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2673)
at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2551)
at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:95)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498)



I have given the proper username and password in the HashTable as mentioned in the sample example.
Can any one please help me with that.
   <<Less

Re: Problem in getting MBean attributes from a JMX remote client program with Administrative Security on

Posted By:   Anonymous  
Posted On:   Friday, April 6, 2007 02:53 AM

String urlForJMX = "service:jmx:rmi:///jndi/rmi://localhost:18510/server";

what is "server" here

Re: Problem in getting MBean attributes from a JMX remote client program with Administrative Security on

Posted By:   Anonymous  
Posted On:   Monday, February 26, 2007 07:38 AM

Hi Reetesh,
I am also trying to connect to jmx service of websphere 6.1 on jdk 1.5. But I am getting the following the following while connecting? Please let me know, how to enable the jmxport in websphere 6.1.


java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: Context: blrkec72954dNode01Cell/nodes/blrkec72954dNode01/servers/server1, name: JMXConnector: First component in name JMXConnector not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:332)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:263)
at JMXRemoteClientApp.connect(JMXRemoteClientApp.java:68)
at JMXRemoteClientApp.main(JMXRemoteClientApp.java:33)
Caused by: javax.naming.NameNotFoundException: Context: blrkec72954dNode01Cell/nodes/blrkec72954dNode01/servers/server1, name: JMXConnector: First component in name JMXConnector not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
at com.ibm.ws.naming.jndicos.CNContextImpl.processNotFoundException(CNContextImpl.java:4730)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1907)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1862)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1552)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1354)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:172)
at javax.naming.InitialContext.lookup(InitialContext.java:363)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1822)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1792)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:274)
... 3 more
Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:85)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(_NamingContextStub.java:504)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:4351)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1901)
... 11 more



I am using the same program given in the link provided by you. One more thing. I could not pmij2ee.jar in the websphere installation folder of was 6.1. I have added the remaining jar files to the client program before execution.

Please reply to bsurendrababu@hotmail.com

Regards,
Surendra
About | Sitemap | Contact