Forum: JRuby Re: Re: Setting JMX attributes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3a4ecaf99c9189e75bff01d8334ca370?d=identicon&s=25 Jay McGaffigan (Guest)
on 2009-02-17 13:32
(Received via mailing list)
<html><head>

<link media="all" type="text/css"
href="/webmail/static/deg/css/wysiwyg-3933289048.css" rel="stylesheet">
</head><body>
We are using the JMX gem Charles mentioned here in our code and not
having any problems.<br>(we are in production too).&nbsp; And we use the
JMX stuff to monitor and manage our
applications.<br><br>Jay<br><br><br>Feb 17, 2009 03:03:20 AM, <a
href="mailto:user@jruby.codehaus.org" class="parsedEmail"
target="_blank">user@jruby.codehaus.org</a> wrote:<br><blockquote
style="border-left: 3px solid rgb(102, 153, 204);">I hate to ask, but
does it do the same from Java? I know JMX is pretty <br>painful to do
from Java so I won't fault you if you haven't tried.<br><br>You might
try pulling Tom Enebo's JMX gem "gem install jmx" since it <br>works
pretty well...then we could at least rule out whether it's <br>specific
to the library.<br><br>Josh Moore wrote:<br>&gt; Hi, I am using edge
jruby edge (rev 9083) and I am trying to set a JMX <br>&gt; attribute.
I can establish the connection and and read the variables no <br>&gt;
problem.  But, when I try to set them I get this exception.  <br>&gt;
<br>&gt; Here is the code that is causing the exception:<br>&gt;
JMX::MBean.find_by_name("com.armorize:type=ScanEngine").maximum_concurrent_scans=(1)
<br>&gt; (Using the jmx4r gem for convience but even when I do not use
jmx4r I <br>&gt; get the same exception see next command).<br>&gt;
conn.set_attribute(ObjectName.getInstance("com.armorize:type=ScanEngine"),
<br>&gt; Attribute.new("MaximumConcurrentScans", 2))<br>&gt; <br>&gt;
Also I checked the MBean interface and I it is expecting an
integer.<br>&gt; <br>&gt; Thanks,<br>&gt; <br>&gt; Josh<br>&gt; <br>&gt;
NativeException: javax.management.InvalidAttributeValueException:
<br>&gt; attribute= MaximumConcurrentScans value = 6<br>&gt;     from
com/sun/jmx/mbeanserver/StandardMetaDataImpl.java:735:in <br>&gt;
`setAttribute'<br>&gt;     from
com/sun/jmx/mbeanserver/StandardMetaDataImpl.java:360:in <br>&gt;
`setAttribute'<br>&gt;     from
com/sun/jmx/mbeanserver/MetaDataImpl.java:206:in `setAttribute'<br>&gt;
from <br>&gt;
com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java:737:in
<br>&gt; `setAttribute'<br>&gt;     from
com/sun/jmx/mbeanserver/JmxMBeanServer.java:722:in
`setAttribute'<br>&gt;     from
javax/management/remote/rmi/RMIConnectionImpl.java:1433:in <br>&gt;
`doOperation'<br>&gt;     from
javax/management/remote/rmi/RMIConnectionImpl.java:81:in <br>&gt;
`access$100'<br>&gt;     from
javax/management/remote/rmi/RMIConnectionImpl.java:1247:in `run'<br>&gt;
from javax/management/remote/rmi/RMIConnectionImpl.java:1343:in <br>&gt;
`doPrivilegedOperation'<br>&gt;     from
javax/management/remote/rmi/RMIConnectionImpl.java:681:in <br>&gt;
`setAttribute'<br>&gt;     from
sun.reflect.GeneratedMethodAccessor150:-1:in `invoke'<br>&gt;     from
sun/reflect/DelegatingMethodAccessorImpl.java:25:in `invoke'<br>&gt;
from java/lang/reflect/Method.java:585:in `invoke'<br>&gt;     from
sun/rmi/server/UnicastServerRef.java:294:in `dispatch'<br>&gt;     from
sun/rmi/transport/Transport.java:153:in `run'<br>&gt;     from
java/security/AccessController.java:-2:in `doPrivileged'<br>&gt; ... 121
levels...<br>&gt;     from org/jruby/ast/NewlineNode.java:104:in
`interpret'<br>&gt;     from org/jruby/ast/BlockNode.java:71:in
`interpret'<br>&gt;     from <br>&gt;
org/jruby/internal/runtime/methods/InterpretedMethod.java:163:in
`call'<br>&gt;     from
org/jruby/internal/runtime/methods/DefaultMethod.java:144:in
`call'<br>&gt;     from
org/jruby/runtime/callsite/CachingCallSite.java:273:in <br>&gt;
`cacheAndCall'<br>&gt;     from
org/jruby/runtime/callsite/CachingCallSite.java:112:in `call'<br>&gt;
from usr/local/share/jruby_edge/bin/jirb:19:in `__file__'<br>&gt;
from usr/local/share/jruby_edge/bin/jirb:-1:in `load'<br>&gt;     from
org/jruby/Ruby.java:575:in `runScript'<br>&gt;     from
org/jruby/Ruby.java:478:in `runNormally'<br>&gt;     from
org/jruby/Ruby.java:352:in `runFromMain'<br>&gt;     from
org/jruby/Main.java:222:in `run'<br>&gt;     from
org/jruby/Main.java:103:in `run'<br>&gt;     from
org/jruby/util/ShellLauncher.java:102:in `run'<br>&gt;     from
java/lang/Thread.java:619:in `run'<br>&gt;
<br><br><br>---------------------------------------------------------------------<br>To
unsubscribe from this list, please visit:<br><br>    <a
href="http://xircles.codehaus.org/manage_email" class="parsedLink"
target="_blank">http://xircles.codehaus.org/manage_email</a><br><b...

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

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.