You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@ws.apache.org by Philippe Langevin <pl...@ctecworld.com> on 2011/03/08 21:25:34 UTC

XmlObject parameter to XmlRPC call

Hi,

I'm trying to pass an org.apache.xmlbeans.XmlObject as a parameter to a call to an apache XmlRpc server.  The server fail and generate the exception at the bottom of this message.

Some info :
- Server under tomcat6
- Using a custom Handler Mapping
- Calling through interfaces (With the mapping)

Actually, the mapping works for many other functions with

Here is the handler mapping initialisation :
protected XmlRpcHandlerMapping newXmlRpcHandlerMapping() throws XmlRpcException {
      PropertyHandlerMapping phm = new PropertyHandlerMapping() ;

      phm.addHandler(ctec.TVLMManager.XmlRpc.TestServer.class.getName(), ctec.TVLMManager.XmlRpc.server.TestServerImpl.class) ;
      phm.addHandler(ctec.TVLMManager.XmlRpc.TVLMServer.class.getName(), ctec.TVLMManager.XmlRpc.server.TVLMServerImpl.class) ;

      return phm ;
}

I also tried adding a custom TypeFactory in the newXmlRpcServer(...) but the getParser(...) method is never called.  On the client side, the getSerializer(...) is called.
protected XmlRpcServletServer newXmlRpcServer(ServletConfig pConfig) throws XmlRpcException {
      XmlRpcServletServer server = super.newXmlRpcServer(pConfig);
      server.setTypeFactory(new CustomTypeFactory(server)) ;

      return server ;
}

java.lang.IllegalStateException: Invalid parameter or result type: org.apache.xmlbeans.XmlObject
        at org.apache.xmlrpc.common.TypeConverterFactoryImpl.getTypeConverter(TypeConverterFactoryImpl.java:296)
        at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler$MethodData.<init>(ReflectiveXmlRpcHandler.java:47)
        at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.<init>(ReflectiveXmlRpcHandler.java:73)
        at org.apache.xmlrpc.metadata.ReflectiveXmlRpcMetaDataHandler.<init>(ReflectiveXmlRpcMetaDataHandler.java:54)
        at org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.newXmlRpcHandler(AbstractReflectiveHandlerMapping.java:188)
        at org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.registerPublicMethods(AbstractReflectiveHandlerMapping.java:169)
        at org.apache.xmlrpc.server.PropertyHandlerMapping.addHandler(PropertyHandlerMapping.java:111)
        at ctec.TVLMManager.XmlRpc.server.TVLMXmlRpcServlet.getPropertyHandlerMapping(TVLMXmlRpcServlet.java:74)
        at ctec.sdk.xmlrpc.CTecXmlRpcServlet.newXmlRpcHandlerMapping(CTecXmlRpcServlet.java:42)
        at org.apache.xmlrpc.webserver.XmlRpcServlet.init(XmlRpcServlet.java:99)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
        at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:394)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:636)

Re: XmlObject parameter to XmlRPC call

Posted by Jochen Wiedmann <jo...@gmail.com>.
You don't mention what underlying technology you are using?
XmlRpcServlet? Native Webserver? What else?

Best would be to publish your initialization code completely.


On Tue, Mar 8, 2011 at 9:25 PM, Philippe Langevin
<pl...@ctecworld.com> wrote:
> Hi,
>
>
>
> I’m trying to pass an org.apache.xmlbeans.XmlObject as a parameter to a call
> to an apache XmlRpc server.  The server fail and generate the exception at
> the bottom of this message.
>
>
>
> Some info :
>
> - Server under tomcat6
>
> - Using a custom Handler Mapping
>
> - Calling through interfaces (With the mapping)
>
>
>
> Actually, the mapping works for many other functions with
>
>
>
> Here is the handler mapping initialisation :
>
> protected XmlRpcHandlerMapping newXmlRpcHandlerMapping() throws
> XmlRpcException {
>
>       PropertyHandlerMapping phm = new PropertyHandlerMapping() ;
>
>
>
>       phm.addHandler(ctec.TVLMManager.XmlRpc.TestServer.class.getName(),
> ctec.TVLMManager.XmlRpc.server.TestServerImpl.class) ;
>
>       phm.addHandler(ctec.TVLMManager.XmlRpc.TVLMServer.class.getName(),
> ctec.TVLMManager.XmlRpc.server.TVLMServerImpl.class) ;
>
>
>
>       return phm ;
>
> }
>
>
>
> I also tried adding a custom TypeFactory in the newXmlRpcServer(…) but the
> getParser(…) method is never called.  On the client side, the
> getSerializer(…) is called.
>
> protected XmlRpcServletServer newXmlRpcServer(ServletConfig pConfig) throws
> XmlRpcException {
>
>       XmlRpcServletServer server = super.newXmlRpcServer(pConfig);
>
>       server.setTypeFactory(new CustomTypeFactory(server)) ;
>
>
>
>       return server ;
>
> }
>
>
>
> java.lang.IllegalStateException: Invalid parameter or result type:
> org.apache.xmlbeans.XmlObject
>
>         at
> org.apache.xmlrpc.common.TypeConverterFactoryImpl.getTypeConverter(TypeConverterFactoryImpl.java:296)
>
>         at
> org.apache.xmlrpc.server.ReflectiveXmlRpcHandler$MethodData.<init>(ReflectiveXmlRpcHandler.java:47)
>
>         at
> org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.<init>(ReflectiveXmlRpcHandler.java:73)
>
>         at
> org.apache.xmlrpc.metadata.ReflectiveXmlRpcMetaDataHandler.<init>(ReflectiveXmlRpcMetaDataHandler.java:54)
>
>         at
> org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.newXmlRpcHandler(AbstractReflectiveHandlerMapping.java:188)
>
>         at
> org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.registerPublicMethods(AbstractReflectiveHandlerMapping.java:169)
>
>         at
> org.apache.xmlrpc.server.PropertyHandlerMapping.addHandler(PropertyHandlerMapping.java:111)
>
>         at
> ctec.TVLMManager.XmlRpc.server.TVLMXmlRpcServlet.getPropertyHandlerMapping(TVLMXmlRpcServlet.java:74)
>
>         at
> ctec.sdk.xmlrpc.CTecXmlRpcServlet.newXmlRpcHandlerMapping(CTecXmlRpcServlet.java:42)
>
>         at
> org.apache.xmlrpc.webserver.XmlRpcServlet.init(XmlRpcServlet.java:99)
>
>         at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
>
>         at
> org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
>
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
>
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>
>         at
> org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:394)
>
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
>
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
>
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
>
>         at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>
>         at java.lang.Thread.run(Thread.java:636)



-- 
I Am What I Am And That's All What I Yam (Popeye)