You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by "Aggarwal, Ajay" <Aj...@stratus.com> on 2009/06/30 20:33:18 UTC

how to enable mapping for methods of return type *void*

Hello all,

 

I am new to this library. I am using version 3.1.2

 

Some methods in my class implementing RPC are of return type VOID. I am
not able to call these methods from my test client. Other methods where
return type is not void are working fine. The error that I see both on
the server side as well as client side is "No such handler". I have
tried explicitly using the method "setVoidMethodEnabled(true)" on
PropertyHandlerMapping on my XmlRpcServer instance. Is this not the
right way to enable mapping for void return type methods?

 

 

The error that I get on the server is

SEVERE: No such handler: pool.join

     [java] org.apache.xmlrpc.server.XmlRpcNoSuchHandlerException: No
such handler: pool.join

     [java]     at
org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.getHandler(Abs
tractReflectiveHandlerMapping.java:214)

     [java]     at
org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.j
ava:45)

     [java]     at
org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:86)

     [java]     at
org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.j
ava:200)

     [java]     at
org.apache.xmlrpc.webserver.Connection.run(Connection.java:208)

     [java]     at
org.apache.xmlrpc.util.ThreadPool$Poolable$1.run(ThreadPool.java:68)

 

And the code that I am using to implement my server is as follows:

 

        WebServer webServer = new WebServer(port); 

        XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer();

       

        PropertyHandlerMapping phm = new PropertyHandlerMapping();

        

        phm.load(Thread.currentThread().getContextClassLoader(),

                 "XmlRpcServlet.properties");

 

        phm.setVoidMethodEnabled(true);

        xmlRpcServer.setHandlerMapping(phm);

      

        XmlRpcServerConfigImpl serverConfig =

            (XmlRpcServerConfigImpl) xmlRpcServer.getConfig();

        serverConfig.setEnabledForExtensions(true);

        serverConfig.setContentLengthOptional(false);

 

        webServer.start();


RE: how to enable mapping for methods of return type *void*

Posted by "Aggarwal, Ajay" <Aj...@stratus.com>.
Thanks. I figured out what I was doing wrong. 

I needed to first enable void methods

        phm.setVoidMethodEnabled(true);

And then load the mappings

        phm.load(...., "XmlRpcServlet.properties");


I was doing it the other way round.

-Ajay


-----Original Message-----
From: Jochen Wiedmann [mailto:jochen.wiedmann@gmail.com] 
Sent: Wednesday, July 01, 2009 11:04 AM
To: xmlrpc-dev@ws.apache.org
Subject: Re: how to enable mapping for methods of return type *void*

On Tue, Jun 30, 2009 at 8:33 PM, Aggarwal,
Ajay<Aj...@stratus.com> wrote:

> Some methods in my class implementing RPC are of return type VOID.

That works only, if

a) both client and server are written in Apache XML-RPC and
b) you are enabling extensions on both and
c) you are enabling void methods on both

Jochen




-- 
Don't trust a government that doesn't trust you.

Re: how to enable mapping for methods of return type *void*

Posted by Jochen Wiedmann <jo...@gmail.com>.
On Tue, Jun 30, 2009 at 8:33 PM, Aggarwal,
Ajay<Aj...@stratus.com> wrote:

> Some methods in my class implementing RPC are of return type VOID.

That works only, if

a) both client and server are written in Apache XML-RPC and
b) you are enabling extensions on both and
c) you are enabling void methods on both

Jochen




-- 
Don't trust a government that doesn't trust you.