Hi all, executing a mbean method with a custom return type i can't cast the returned object instance to the appropriate data type.
ClassCastException: anonymous wrote : | java.lang.ClassCastException: mypackage.MyDto cannot be cast to mypackage.MyDto MBean: | public interface MyMBean extends org.jboss.system.ServiceMBean { | ... | public MyDto holeMyDto(String test) throws Exception; | ... | } | Dto (Data Transfer object) | public class MyDto implements Serializable { | private static final long serialVersionUID = 3679919263323839707L; | ... | } | Client (deployed in a separate .war) | InitialContext ic = new InitialContext(); | String rmiadaptername = "jmx/invoker/RMIAdaptor"; | MBeanServerConnection mbsc = (MBeanServerConnection) ic.lookup(rmiadaptername); | ObjectName objectName = new ObjectName(objectNameString); | Object[] oa = { "P"}; | String[] sa = { "java.lang.String"}; | Object object = mbsc.invoke(objectName, "holeMyDto", oa, sa); | DataPoolInfo result = (DataPoolInfo) object; // here comes the Exception | The execution from the jmx-console works fine. Please help. Jboss 4.0.5 GA; Jdk 6. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043949#4043949 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043949 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user