This happened to me. It turned out that the method is being looked up by not only the name, but the signature. Your code indicates that the signature of the method is empty by the fact that your code uses newObject, new String . I suggest you try passing null for both those values in the invoke method. If it worked in 2.2, but not in 3.0, I would chalk that up to JBoss having a better implementation of JMX in 3.0.
thanks for the help senor turner!
unfortunately, that didn't work for me. i tried changing the parameters passed in to null, as well as setting their values to null. neither tactic worked. ??? i am using JBoss 3.0.0 (current when i started this little migration journey...) if that info is any help.
thanks again for any help/advice!...
<i tried changing the parameters passed in to null, as well as setting their values to null>
I'm confused what the difference is.
The code should be:
Does your MBean and method appear in 8082?
The only other thing I know to do is take the bitter pill and go in there with the debugger and see whats happening.
a little sleight of hand there, sorry! i condensed and 'paraphrased' the code... in actuality, the code declares 2 local array variables, which are the parameters passed in, and then calls invoke( ) with the references. i tried commenting out the original invoke( ) call, and replaced it with an invoke( ) with nulls as parameters and not the variables. didn't work... so i then tried setting the references to null (instead of the empty arrays) when they are declared, and then using the original method call. LONG shot, and again no dice.
the MBean does indeed appear in the agent view, but when i click on it to view it, only a small subset of the methods appear. it shows the MBean lifecycle callback methods, and a single business method. everything else is nowhere to be seen. (evidently the root of the problem...)
i assume you mean getting in the JBoss code with the debugger... sounds interesting, if a bit scary. thanks for the excellent and prompt help and advice! =) i am new to this project, as well as JBoss, and it has really been quite a learning process.
i am also going to try casting the MBean reference, and calling the method explicity rather than with reflection. someone in our meeting this morning suggested that we could do this. well, at leaast i have a couple different options now...
< going to try casting the MBean reference>
If you mean casting the ObjectInstance, that won't work since ObjectInstance is not in the class hierarchy of your MBean.
If things don't look right in the agent view, then fix that first. Go method by method, making sure correct pattern is followed for setters and getters, and method name in interface matches method name in class. Shut down JBoss and delete tmp directory.
i just figured that out...i was thinking objectInstance was an instance of Object. doh! =(
ok. will try your suggestions. gracias!
You need to use server.getAttribute("AttributeName") to read an attribute value rather than server.invoke() which only works for operations.
Nothing like getting the right answer from the master !! Thanks Juha.