Sending other than strings to jolokia exec parameters

classic Classic list List threaded Threaded
4 messages Options
mabbas mabbas
Reply | Threaded
Open this post in threaded view
|

Sending other than strings to jolokia exec parameters

Hi,

The following has been happening when I do the following
curl http://localhost:8778/jolokia/exec/com.xe.theblender:service=override/setOverride/"CAD"/20.00

I get:

Operation setOverride on MBean com.xe.theblender:service=override is overloaded.
Signatures found:
(java.lang.String,java.lang.Double),
(java.lang.String,java.lang.Double,java.lang.String),
(java.lang.String,java.lang.Double,java.lang.String,java.lang.String).
Use a signature when specifying the operation.","status":400,
"request":{"operation":"setOverride","mbean":"com.xe.theblender:service=override","arguments":["CAD","20.00"],"type":"exec"},
"stacktrace":"java.lang.IllegalArgumentException: Operation setOverride on MBean com.xe.theblender:service=override is overloaded.
Signatures found:
(java.lang.String,java.lang.Double),
(java.lang.String,java.lang.Double,java.lang.String),
(java.lang.String,java.lang.Double,java.lang.String,java.lang.String).


Plainly, it's casting the double I'm sending as string, which is not working. My question is how do I cast it to double?
roland roland
Reply | Threaded
Open this post in threaded view
|

Re: Sending other than strings to jolokia exec parameters

When you use overloaded methods (which BTW is not recommend for JMX, even not in the Specs), you need to specify the signature of the mehod as described in the Reference Manual (see table 6.6 for an example)
... roland
mabbas mabbas
Reply | Threaded
Open this post in threaded view
|

Re: Sending other than strings to jolokia exec parameters

Ah I see so, I got my js version working, but it had the same issue:

So do I include a

"name": methodName(String, Double)

in the object I'm sending?

And btw, great software, and fantastic response time, thank you.
mabbas mabbas
Reply | Threaded
Open this post in threaded view
|

Re: Sending other than strings to jolokia exec parameters

brilliant, I got it to work, you're great :)