You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@ws.apache.org by sean <se...@celsoft.com> on 2002/10/29 08:09:19 UTC

Handler Trouble

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


Re: Handler Trouble

Posted by sean <se...@celsoft.com>.
Hmm...argument mismatch?  I wasn't passing any arguments at all, but 
I'll try adding some and see what that gets me.

I guess I can go back to the Execute method and perform my own method 
lookups if this doesn't work out...it just seemed so eloquent having the 
invoker look methods up.

Thanks Martin,

    Sean O'Dell

Martin Redington wrote:

> The only thing I can think of offhand, looking at the server 
> documentation, is that you've somehow fallen afoul of some kind of 
> argument mismatch. May be you could try playing around with arguments:
>
> 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
>>>>
>>>>
>>
>>
>>
>>




Re: Handler Trouble

Posted by sean <se...@celsoft.com>.
Hmm...argument mismatch?  I wasn't passing any arguments at all, but 
I'll try adding some and see what that gets me.

I guess I can go back to the Execute method and perform my own method 
lookups if this doesn't work out...it just seemed so eloquent having the 
invoker look methods up.

Thanks Martin,

    Sean O'Dell

Martin Redington wrote:

> The only thing I can think of offhand, looking at the server 
> documentation, is that you've somehow fallen afoul of some kind of 
> argument mismatch. May be you could try playing around with arguments:
>
> 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
>>>>
>>>>
>>
>>
>>
>>




Re: Handler Trouble

Posted by Martin Redington <m....@ucl.ac.uk>.
The only thing I can think of offhand, looking at the server 
documentation, is that you've somehow fallen afoul of some kind of 
argument mismatch. May be you could try playing around with arguments:

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
>>>
>>>
>
>
>
>


Re: Handler Trouble

Posted by Martin Redington <m....@ucl.ac.uk>.
The only thing I can think of offhand, looking at the server 
documentation, is that you've somehow fallen afoul of some kind of 
argument mismatch. May be you could try playing around with arguments:

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
>>>
>>>
>
>
>
>


Re: Handler Trouble

Posted by sean <se...@celsoft.com>.
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
>>
>>




Re: Handler Trouble

Posted by sean <se...@celsoft.com>.
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
>>
>>




Re: List archive

Posted by Daniel Rall <dl...@finemaltcoding.com>.
"Danny Angus" <da...@apache.org> writes:

> Mornin,
> 
> Is there an archive for this list anywhere?  I looked in all the
> usual places, and only found xml.apache.org/mail/, which is
> something, but not very friendly.

http://archives.apache.org/eyebrowse/SummarizeList?listName=rpc-dev@xml.apache.org
http://archives.apache.org/eyebrowse/SummarizeList?listName=rpc-user@xml.apache.org
-- 

Daniel Rall <dl...@finemaltcoding.com>

Re: List archive

Posted by Daniel Rall <dl...@finemaltcoding.com>.
"Danny Angus" <da...@apache.org> writes:

> Mornin,
> 
> Is there an archive for this list anywhere?  I looked in all the
> usual places, and only found xml.apache.org/mail/, which is
> something, but not very friendly.

http://archives.apache.org/eyebrowse/SummarizeList?listName=rpc-dev@xml.apache.org
http://archives.apache.org/eyebrowse/SummarizeList?listName=rpc-user@xml.apache.org
-- 

Daniel Rall <dl...@finemaltcoding.com>

List archive

Posted by Danny Angus <da...@apache.org>.
Mornin,

Is there an archive for this list anywhere?
I looked in all the usual places, and only found xml.apache.org/mail/, which is something, but not very friendly.

d.


List archive

Posted by Danny Angus <da...@apache.org>.
Mornin,

Is there an archive for this list anywhere?
I looked in all the usual places, and only found xml.apache.org/mail/, which is something, but not very friendly.

d.


Re: Handler Trouble

Posted by Martin Redington <m....@ucl.ac.uk>.
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
>
>


Re: Handler Trouble

Posted by Martin Redington <m....@ucl.ac.uk>.
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
>
>