1. If you pass the XmlRpcServer any Java object, the server will try to resolve incoming calls via object introspection, i.e. by looking for public methods in the handler object corresponding to the method name and the parameter types of incoming requests. The input parameters of incoming XML-RPC requests must match the argument types of the Java method (see conversion table), or otherwise the method won't be found. The return value of the Java method must be supported by XML-RPC.
(from http://xml.apache.org/xmlrpc/server.html)
On Tuesday, October 29, 2002, at 04:21 PM, sean wrote:
Actually, maybe I didn't emphasize this one point enough. If I change the name of the method I'm trying to call to a method that doesn't exist, I do get a "method not found" error. It's only when I specify the correct method name that I get this error. That says to me "the invoker has found the method, but it's complaining."
Just trying to figure out why it's complaining. The invoker has clearly found the method, and it's definitely a public method...but it complains about the method being public.
Sean O'Dell
Martin Redington wrote:
I haven't tried playing with your code, but I think this may be the expected behaviour (with a poorly written error message).
When you invoke test.testmethod, the WebServer (or some component of it) looks for the handler registered under the name "test", and then uses introspection to find the "testmethod" method.
If you try and call something else, e.g. test.someothermethod, then the WebServer looks for a "someothermethod" method on the registered handler.
As there isn't a method called "someothermethod", it throws an exception with the message:
Class org.apache.xmlrpc.Invoker can not access a member of class TestHandler with modifiers "public"
This presumably actually means: "I couldn't find a public method in the TestHandler class called "someothermethod", so I'm stuffed".
Hope this helps,
cheers,
Martin
On Tuesday, October 29, 2002, at 07:09 AM, sean wrote:
I got Martin's "TestServer" example working, and then I went on to try and make a "non-XmlRpcHandler" handler, hoping it would perform the object introspection as explained in the server how-to. My test client keeps giving me this odd error I can't seem to get rid of:
Class org.apache.xmlrpc.Invoker can not access a member of class TestHandler with modifiers "public"
This error is actually thrown by the XML-RPC web server. Here's the code for TestHandler:
class TestHandler
{
public String testerror() throws Exception
{
System.err.println("TestServer: executing " + "testerror");
throw new XmlRpcException(20, "this is an error");
}
}
I set up the handler in "public static void main" like this:
TestHandler testHandler = new TestHandler();
webServer.addHandler("test", testHandler);
Clearly, the method is being found because when I call "test.testerror" from the client, I get that error, but if I change the call to use any other name, it throws a "method not found" sort of error.
Why is the Invoker (I think that's who is throwing the error) throwing an error and complaining about the testerror method being public? Isn't is supposed to be public?
Sean O'Dell
