Hi,
I have setup a cluster partition in Jboss and trying to retrieve HAPartition
object from ClusterPartition mbean. Below is my code:
ArrayList<MBeanServer> list = MBeanServerFactory.findMBeanServer(null);
for (MBeanServer server : list)
{
String onStr = "jboss:service=DefaultPartition";
ObjectName objectName = new ObjectName(onStr);
Set mbeans = server.queryMBeans(objectName, null);
Object partitionObj = server.invoke(theName, "getHAPartition",
null, null);
org.jboss.ha.framework.server.HAPartitionImpl partition =
(org.jboss.ha.framework.server.HAPartitionImpl) partitionObj; //this line
throwing ClassCastException
}
The last line in above code is throwing ClasscastException: Cannot Cast
org.jboss.ha.framework.server.HAPartitionImpl cannot be cast to
org.jboss.ha.framework.server.HAPartitionImpl
I have same version of jbossha.jar in jboss lib and war's web-inf/lib
folder. I am not sure why it is throwing classcast exception. Any help is
much appreciated.
Thanks in advance !!!
Regards,
Dharmveer
--
View this message in context:
http://www.nabble.com/ClasscastException%3A-Cannot-Cast-org.jboss.ha.fram...
Sent from the JBoss - Dev mailing list archive at
Nabble.com.