Re: Re: Setting JMX attributes

We are using the JMX gem Charles mentioned here in our code and not having any problems.
(we are in production too).  And we use the JMX stuff to monitor and manage our applications.

Jay


Feb 17, 2009 03:03:20 AM, [email protected] wrote:
I hate to ask, but does it do the same from Java? I know JMX is pretty
painful to do from Java so I won't fault you if you haven't tried.

You might try pulling Tom Enebo's JMX gem "gem install jmx" since it
works pretty well...then we could at least rule out whether it's
specific to the library.

Josh M. wrote:
> Hi, I am using edge jruby edge (rev 9083) and I am trying to set a JMX
> attribute. I can establish the connection and and read the variables no
> problem. But, when I try to set them I get this exception.
>
> Here is the code that is causing the exception:
> JMX::MBean.find_by_name("com.armorize:type=ScanEngine").maximum_concurrent_scans=(1)
> (Using the jmx4r gem for convience but even when I do not use jmx4r I
> get the same exception see next command).
> conn.set_attribute(ObjectName.getInstance("com.armorize:type=ScanEngine"),
> Attribute.new("MaximumConcurrentScans", 2))
>
> Also I checked the MBean interface and I it is expecting an integer.
>
> Thanks,
>
> Josh
>
> NativeException: javax.management.InvalidAttributeValueException:
> attribute= MaximumConcurrentScans value = 6
> from com/sun/jmx/mbeanserver/StandardMetaDataImpl.java:735:in
> `setAttribute'
> from com/sun/jmx/mbeanserver/StandardMetaDataImpl.java:360:in
> `setAttribute'
> from com/sun/jmx/mbeanserver/MetaDataImpl.java:206:in `setAttribute'
> from
> com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java:737:in
> `setAttribute'
> from com/sun/jmx/mbeanserver/JmxMBeanServer.java:722:in `setAttribute'
> from javax/management/remote/rmi/RMIConnectionImpl.java:1433:in
> `doOperation'
> from javax/management/remote/rmi/RMIConnectionImpl.java:81:in
> `access$100'
> from javax/management/remote/rmi/RMIConnectionImpl.java:1247:in `run'
> from javax/management/remote/rmi/RMIConnectionImpl.java:1343:in
> `doPrivilegedOperation'
> from javax/management/remote/rmi/RMIConnectionImpl.java:681:in
> `setAttribute'
> from sun.reflect.GeneratedMethodAccessor150:-1:in `invoke'
> from sun/reflect/DelegatingMethodAccessorImpl.java:25:in `invoke'
> from java/lang/reflect/Method.java:585:in `invoke'
> from sun/rmi/server/UnicastServerRef.java:294:in `dispatch'
> from sun/rmi/transport/Transport.java:153:in `run'
> from java/security/AccessController.java:-2:in `doPrivileged'
> ... 121 levels...
> from org/jruby/ast/NewlineNode.java:104:in `interpret'
> from org/jruby/ast/BlockNode.java:71:in `interpret'
> from
> org/jruby/internal/runtime/methods/InterpretedMethod.java:163:in `call'
> from org/jruby/internal/runtime/methods/DefaultMethod.java:144:in `call'
> from org/jruby/runtime/callsite/CachingCallSite.java:273:in
> `cacheAndCall'
> from org/jruby/runtime/callsite/CachingCallSite.java:112:in `call'
> from usr/local/share/jruby_edge/bin/jirb:19:in `__file__'
> from usr/local/share/jruby_edge/bin/jirb:-1:in `load'
> from org/jruby/Ruby.java:575:in `runScript'
> from org/jruby/Ruby.java:478:in `runNormally'
> from org/jruby/Ruby.java:352:in `runFromMain'
> from org/jruby/Main.java:222:in `run'
> from org/jruby/Main.java:103:in `run'
> from org/jruby/util/ShellLauncher.java:102:in `run'
> from java/lang/Thread.java:619:in `run'
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email



To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email