[jboss-dev] ClasscastException: Cannot Cast org.jboss.ha.framework.server.HAPartitionImpl cannot be cast to org.jboss.ha.framework.server.HAPartitionImpl

Dharmveer Jain dharmveer_jain at yahoo.com
Fri Oct 16 16:15:41 EDT 2009


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 



      Yahoo! India has a new look. Take a sneak peek http://in.yahoo.com/trynew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-development/attachments/20091017/33cfdbc2/attachment.html 


More information about the jboss-development mailing list