cancel
Showing results for 
Search instead for 
Did you mean: 

Class Cast Exception

Former Member
0 Kudos

Hi there,

i´ve got some trouble to Cat an Objectname.

		    
			InitialContext initCtx = new InitialContext();
			MBeanServer mbs = (MBeanServer) initCtx.lookup("jmx");
                        ObjectName name = .....;
			IMonitorNode node = (IMonitorNode) mbs.getAttribute(name, "MonitorNode");
			String cfgGroup = node.getConfigurationGroup();

I whant to recieve the name of a ConfigurationGroup from an Application Monitor. This Monitor is running well.

So, after Deployment ive got a java.lang.ClassCastException and i dont know how can i solve this exception.

Does anyone have some solution for me?

Regards

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

With wich class do you have a ClassCastException ?

During your deployment do you have maybe forgotten the concerned java library ?

Best regards,

Mathieu

PS : reward points if helpful

Former Member
0 Kudos

Hi....I am having same issue (ClassCastException).

This exception occurs on line.......... javax.management.MBeanServer mbs = (javax.management.MBeanServer) initCtx.lookup("jmx");

Any Ideas....?

Thanks,

Mandeep

Former Member
0 Kudos

hi,

may it is possible that u you have the MBeanServer loaded with different class loaders.

check ur default classloader and the classloader of MBeanServer.class.

Or try out in case using MBeanServerConnection.class

Former Member
0 Kudos

I could resolve it ...The issue was not adding the proper reference in the EAR project - http://help.sap.com/saphelp_nw04/helpdata/en/f6/c9bb997ca1d446a3a176d519ab59a8/content.htm