[jboss-user] [Management, JMX/JBoss] - MBean operation works only after invoking operation from jmx
gtjonesy
do-not-reply at jboss.com
Wed Feb 20 19:59:07 EST 2008
Hi,
Using 4.2.2
I am having what looks like a strange problem but hopping that is something simple. I have look in many different places to find an answer but I am not sure if I am looking for the right thing.
I have an MBean that was created using this approach
@Service (objectName="platform:service=foo")
| @Management (foo.class)
That stores some information that is updated periodically.
I have a class in a struts2 action that does this to access the data
MBeanServer server = org.jboss.mx.util.MBeanServerLocator.locateJBoss();
| ObjectName name = new ObjectName("platform:service=foo");
|
| return (Collection) server.invoke(name, "fooMethod", null, null);
The problem that I have is that this code does not work. I get this error:
Caused by: java.lang.NullPointerException
| at org.jboss.ejb3.service.ServiceMBeanDelegate.getOperation(ServiceMBeanDelegate.java:380)
| at org.jboss.ejb3.service.ServiceMBeanDelegate.invoke(ServiceMBeanDelegate.java:214)
| ... 151 more
But if I invoke the operation from jmx-console the method works like it should.
Any help on what I am missing would be greatly appreciated.
Thanks in advanced,
Greg
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130955#4130955
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4130955
More information about the jboss-user
mailing list