How to set jmx.invoke.getters property ?
I use Tomcat 5.5 and JRE 1.5. Whenever I tried to start Tomcat programatically, I get this error:
javax.management.ReflectionException: Cannot invoke getter or setter (setInterval) as operation unless jmx.invoke.getters property is set
Where and how do I set "jmx.invoke.getters" property?
My code that causes this problem is:
mBeanServer.getMethod().invoke(methodName, params);
Thanks,
Tuan Nguyen
[442 byte] By [
tn2001a] at [2007-11-27 4:01:41]

# 1
Warning: I haven't the the first clue about Tomcat nor how to start it programmatically.
It sounds like you need to invoke the MBeanServer.setAttribute(..) method instead of the MBeanServer.invoke(..) method.
I'm not familiar with the getMethod() method you are invoking but I presume it is a reflective call of some sorts that return the MBeanServer interface?
Regards,
Eske
# 2
Hi,
Usually you set the property on the Java command line.
Tomcat probably has a configuration file that will let you add additional
properties/flags...
Otherwise you can try to find out which script is starting Tomcat, and
add the property there.
java -Djmx.invoke.getters=true ...
Using JMX you are not supposed to invoke getters through
MBeanServer.invoke(name,"getSomething",null,null),
you are supposed to use MBeanServer.getAttribute(name,"Something") instead.
The jmx.invoke.getters=true property will let you use the first 'invoke' form,
which is not compliant with the spec.
More info there
http://forum.java.sun.com/thread.jspa?threadID=765506&messageID=4365159
Hope this helps,
-- daniel
JMX, SNMP, Java, etc...
http://blogs.sun.com/jmxetc