Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem calling retrieveClusters on ClusterMgr mbean: invoke fails

47 views
Skip to first unread message

Stephen Gomory

unread,
Jul 22, 2003, 4:05:01 PM7/22/03
to
Hi,

I have a simple java program (see below) that attempts to invoke the
"retrieveClusters" method on the ClusterMgr mbean

(class name is javax.management.modelmbean.RequiredModelMBean).

When I invoke the method (either through RMI or SOAP) I get a failure on the
server side indicating that the type

"[Lcom.ibm.websphere.management.wlm.ClusterData" is not known to the server.
I am using the AdminClient class

(com.ibm.websphere.management.AdminClient) to make the connection. The bean
itself is found on the server, and

inquiry of the bean using "MBeanOperationInfo" indicates that the bean
exists and that the "retrieveClusters" method is

exposed. I am connecting to the DeploymentManager of a cluster of two
servers each on a separate node. When I call the

method I get the server-side error:

if SOAP connector used:

[SOAPException: faultCode=SOAP-ENV:Client;
msg=com.ibm.websphere.management.wlm.ClusterData;
targetException=java.lang.IllegalArgumentException:
com.ibm.websphere.management.wlm.ClusterData]

if rmi connector used: org.omg.CORBA.NO_IMPLEMENT: Unable to locate value
class 1[Lcom.ibm.websphere.management.wlm.ClusterData; minor code: 4F4D0001
completed: No

(Detailed test results and sample code below)

I don't know if this is a classpath issue -- I suspect it is not. In

any case, the class file "ClusterData" is found in wlmclient.jar which

is in the lib dir of the cell manager (example:

/opt/WebSphere/DeploymentManager/lib). Is this jar file not in the

server's classpath by default?

Does anyone know the cause of the problem and how to fix it? Alternatively,

is there another method to determine what clusters deployed are and who
there members of the cluster are?

Thanks,

Steve

gom...@smarts.com

======================

// OUTPUT UNDER RMI

======================

getAdminClient: host=flash , portStr=9917 connector=RMI

found mbean for cluster manager:
WebSphere:platform=common,cell=asm_network,version=5.0,name=ClusterMgr,mbean
Identifier=ClusterMgr,type=ClusterMgr,node=flashManager,process=dmgr

available methods and attributes for:
WebSphere:platform=common,cell=asm_network,version=5.0,name=ClusterMgr,mbean
Identifier=ClusterMgr,type=ClusterMgr,node=flashManager,process=dmgr

BeanInfo for javax.management.modelmbean.RequiredModelMBean The Cluster
Manager MBean provides access to cluster and cluster member information for
the cell.

Attributes: <no attributes found>

Operations:

Operation name=retrieveClusters returns:
[Lcom.ibm.websphere.management.wlm.ClusterData;

Operation name=retrieveCluster returns:
com.ibm.websphere.management.wlm.ClusterData param type=java.lang.String

Operation name=retrieveClusterByMember returns:
com.ibm.websphere.management.wlm.ClusterData param type=java.lang.String
param type=java.lang.String

calling 'retrieveClusters'

com.ibm.websphere.management.exception.ConnectorException: RemoteException
received

at
com.ibm.ws.management.connector.rmi.RMIConnectorClient.handleRemoteException
(RMIConnectorClient.java:225)

at
com.ibm.ws.management.connector.rmi.RMIConnectorClient.invoke(RMIConnectorCl
ient.java:421)

at
com.ibm.ws.management.AdminClientImpl.invoke(AdminClientImpl.java:162)

at
com.smarts.discovery.test.ClusterTest.printClusterMembers(ClusterTest.java:7
0)

at
com.smarts.discovery.test.ClusterTest.test(ClusterTest.java:51)

at
com.smarts.discovery.test.ClusterTest.main(ClusterTest.java:32)

---- Begin backtrace for nested exception

java.rmi.RemoteException: CORBA NO_IMPLEMENT 0x4f4d0001 No; nested exception
is:

org.omg.CORBA.NO_IMPLEMENT: Unable to locate value class
1[Lcom.ibm.websphere.management.wlm.ClusterData; minor code: 4F4D0001
completed: No

org.omg.CORBA.NO_IMPLEMENT: Unable to locate value class
1[Lcom.ibm.websphere.management.wlm.ClusterData; minor code: 4F4D0001
completed: No

at
com.ibm.rmi.iiop.CDRInputStream.read_value(CDRInputStream.java(Compiled
Code))

at
com.ibm.rmi.iiop.CDRInputStream.readAnyOpt(CDRInputStream.java:880)

at
com.ibm.CORBA.iiop.UtilDelegateImpl.readAny(UtilDelegateImpl.java:336)

at javax.rmi.CORBA.Util.readAny(Util.java:98)

at
com.ibm.ws.management.connector.rmi._RMIConnector_Stub.invoke(_RMIConnector_
Stub.java:431)

at
com.ibm.ws.management.connector.rmi.RMIConnectorClient.invoke(RMIConnectorCl
ient.java:414)

at
com.ibm.ws.management.AdminClientImpl.invoke(AdminClientImpl.java:162)

at
com.smarts.discovery.test.ClusterTest.printClusterMembers(ClusterTest.java:7
0)

at
com.smarts.discovery.test.ClusterTest.test(ClusterTest.java:51)

at
com.smarts.discovery.test.ClusterTest.main(ClusterTest.java:32)

======================

// OUTPUT UNDER SOAP

======================

getAdminClient: host=flash , portStr=8889 connector=SOAP

found mbean for cluster manager:
WebSphere:platform=common,cell=asm_network,version=5.0,name=ClusterMgr,mbean
Identifier=ClusterMgr,type=ClusterMgr,node=flashManager,process=dmgr

available methods and attributes for:
WebSphere:platform=common,cell=asm_network,version=5.0,name=ClusterMgr,mbean
Identifier=ClusterMgr,type=ClusterMgr,node=flashManager,process=dmgr

BeanInfo for javax.management.modelmbean.RequiredModelMBean The Cluster
Manager MBean provides access to cluster and cluster member information for
the cell.

Attributes: <no attributes found>

Operations:

Operation name=retrieveClusters returns:
[Lcom.ibm.websphere.management.wlm.ClusterData;

Operation name=retrieveCluster returns:
com.ibm.websphere.management.wlm.ClusterData param type=java.lang.String

Operation name=retrieveClusterByMember returns:
com.ibm.websphere.management.wlm.ClusterData param type=java.lang.String
param type=java.lang.String

calling 'retrieveClusters'

com.ibm.websphere.management.exception.ConnectorException: ADMC0009E: Failed
to make the SOAP RPC call: invoke

at
com.ibm.ws.management.connector.soap.SOAPConnectorClient.invokeTemplate(SOAP
ConnectorClient.java:465)

at
com.ibm.ws.management.connector.soap.SOAPConnectorClient.invoke(SOAPConnecto
rClient.java:382)

at
com.ibm.ws.management.connector.soap.SOAPConnectorClient.invoke(SOAPConnecto
rClient.java:207)

at $Proxy0.invoke(Unknown Source)

at
com.ibm.ws.management.AdminClientImpl.invoke(AdminClientImpl.java:162)

at
com.smarts.discovery.test.ClusterTest.printClusterMembers(ClusterTest.java:7
0)

at
com.smarts.discovery.test.ClusterTest.test(ClusterTest.java:51)

at
com.smarts.discovery.test.ClusterTest.main(ClusterTest.java:32)

---- Begin backtrace for nested exception

[SOAPException: faultCode=SOAP-ENV:Client;
msg=com.ibm.websphere.management.wlm.ClusterData;
targetException=java.lang.IllegalArgumentException:
com.ibm.websphere.management.wlm.ClusterData]

at org.apache.soap.rpc.Call.invoke(Unknown Source)

at
com.ibm.ws.management.connector.soap.SOAPConnectorClient.invokeTemplate(SOAP
ConnectorClient.java:437)

at
com.ibm.ws.management.connector.soap.SOAPConnectorClient.invoke(SOAPConnecto
rClient.java:382)

at
com.ibm.ws.management.connector.soap.SOAPConnectorClient.invoke(SOAPConnecto
rClient.java:207)

at $Proxy0.invoke(Unknown Source)

at
com.ibm.ws.management.AdminClientImpl.invoke(AdminClientImpl.java:162)

at
com.smarts.discovery.test.ClusterTest.printClusterMembers(ClusterTest.java:7
0)

at
com.smarts.discovery.test.ClusterTest.test(ClusterTest.java:51)

at
com.smarts.discovery.test.ClusterTest.main(ClusterTest.java:32)

======================

// SOURCE CODE FOR TEST

=====================

package com.smarts.discovery.test;

import java.io.IOException;

import com.ibm.websphere.management.exception.*;

import javax.management.*;

import java.util.*;

import java.io.*;

import com.ibm.websphere.management.AdminClient;

import com.ibm.websphere.management.AdminClientFactory;

import javax.management.ObjectName;

import com.ibm.websphere.management.wlm.ClusterData;

/**

* @author gomorys

*

* To change this generated comment edit the template variable
"typecomment":

* Window>Preferences>Java>Templates.

* To enable and disable the creation of type comments go to

* Window>Preferences>Java>Code Generation.

*/

public class ClusterTest {

AdminClient ac = null;

public ClusterTest() throws Exception {

//setAdminClient("flash", "8889", "SOAP");

setAdminClient("flash", "9917", "RMI");

}

public static void main(String[] args) {

try {

ClusterTest instance = new
ClusterTest();

instance.test();

} catch (Exception e) {

e.printStackTrace();

return;

}

}

public void test() throws Exception {

ObjectName on = new ObjectName("WebSphere*:*");

// get all objectnames for this server

Set objectNameSet = ac.queryNames(on, null);

Iterator i = objectNameSet.iterator();

while (i.hasNext()) {

on = (ObjectName) i.next();

String type = on.getKeyProperty("type");

if (!type.equals("ClusterMgr")) {

continue;

}

System.out.println("found mbean for
cluster manager: " + on);

printClusterMembers(on);

System.out.println("success");

}

}

/**

* temporary test

*

*/

private void printClusterMembers(ObjectName on) throws Exception
{

System.out.println("available methods and attributes
for: " + on);

System.out.println( getBeanInfoAsString(on) );

String method = "retrieveClusters";

System.out.println("calling '" + method + "'");

Object[] params = null; //new Object[0];

String[] signature = null; // new String[0];

Object o = ac.invoke(on, method, params, signature);

System.out.println("for method " + method + " invoke
returned: " + o);

ClusterData clusterData = (ClusterData) o;

System.out.println("cast succeeded");

}

public void setAdminClient(

String hostStr,

String portStr,

String connector)

throws Exception {

System.out.println(

"getAdminClient: host="

+ hostStr

+ " , portStr="

+ portStr

+ " connector="

+ connector);

java.util.Properties props = new
java.util.Properties();

props.put(AdminClient.CONNECTOR_TYPE, connector);

props.put(AdminClient.CONNECTOR_HOST, hostStr);

props.put(AdminClient.CONNECTOR_PORT, portStr);

ac = AdminClientFactory.createAdminClient(props);

}

private String getBeanInfoAsString(ObjectName on) {

String s="";

try {

MBeanInfo info = ac.getMBeanInfo(on);

s = "BeanInfo for " +
info.getClassName() + " " + info.getDescription() + "\n";

MBeanAttributeInfo[] attributes =
info.getAttributes();

String attributeDescription =
"Attributes: ";

if (attributes.length == 0) {

attributeDescription += "<no
attributes found>";

}

attributeDescription += "\n";

for (int i=0; i<attributes.length; i++)
{

MBeanAttributeInfo attInfo =
attributes[i];

attributeDescription +=
"Attribute: " +

"name=" +
attInfo.getName() + " " +

"type=" +
attInfo.getType() + " " +

"isReadable=" +
attInfo.isReadable() + "\n";

}

MBeanOperationInfo[] operations =
info.getOperations();

String operationDescription =
"Operations: ";

if (operations.length == 0) {
operationDescription += "<no ops found>"; }

operationDescription += "\n";

for (int i=0; i<operations.length; i++)
{

MBeanOperationInfo opInfo =
operations[i];

operationDescription +=
"Operation name=" + opInfo.getName() + " returns: " + opInfo.getReturnType()
+ " " ;

MBeanParameterInfo[]
paramsInfo = opInfo.getSignature();

for (int j=0;
j<paramsInfo.length; j++) {


MBeanParameterInfo paramInfo = paramsInfo[j];


operationDescription += "param type=" + paramInfo.getType() + " ";

}

operationDescription +=
"\n";

}

return s + attributeDescription +
operationDescription + "\n";

}

catch(Exception e) {

e.printStackTrace();

s = e.toString();

}

return s;

}

}


0 new messages