Ok, so. I’ve got a war deployed with an MBean exposed through spring’s MBeanExporter and annotations. I have another war app deployed which is using some code to talk to the mbean. I’m having an issue calling the function on the mbean from that client code.
RuntimeException occurred in RequiredModelMBean while trying to invoke operation getPermissions.
The signature of the mbean method is Collection getPermissions(GrantedAuthority role).
and the code I’m using to call it is
Object[] params = {role}; //role is passed in as a GrantedAuthorityImpl (implements GrantedAuthority)
String[] signature = {"org.springframework.security.core.authority.GrantedAuthority"};
mbeanServer.invoke(new ObjectName(mbeanName), "getPermissions", params, signature);
What could be the issue, or what should I look at?
javax.management.RuntimeOperationsException: RuntimeException occurred in RequiredModelMBean while trying to invoke operation getPermissions
javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1080)
javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:955)
org.springframework.jmx.export.SpringModelMBean.invoke(SpringModelMBean.java:90)
org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
org.jboss.mx.modelmbean.RequiredModelMBeanInvoker.invoke(RequiredModelMBeanInvoker.java:127)
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
xxx.MBeanPermissionMapLookup.getPermissions(MBeanPermissionMapLookup.java:31)
xxx.MBeanPermissionMapLookup$$FastClassByCGLIB$$667f3fad.invoke(<generated>) ...
root cause: java.lang.IllegalArgumentException: argument type mismatch
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
sun.reflect.misc.Trampoline.invoke(MethodUtil.java:37)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:244)
javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1074)
javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:955)
org.springframework.jmx.export.SpringModelMBean.invoke(SpringModelMBean.java:90)
org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
org.jboss.mx.modelmbean.RequiredModelMBeanInvoker.invoke(RequiredModelMBeanInvoker.java:127)
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
xxx.MBeanPermissionMapLookup.getPermissions(MBeanPermissionMapLookup.java:31)
Using Spring 3.0.4, Spring security 3.0.3, jboss 5.1.0, java jdk 1.6.0-17.
The classes in question can’t cross a classloader boundary, it’s an argument-type mismatch because the classloader is internally part of the type within jboss.