[ http://issues.apache.org/jira/browse/XMLRPC-71?page=comments#action_12332174 ]
Chris Wilson commented on XMLRPC-71: ------------------------------------ Hi Jochen, Thans for looking into this issue for me. I understand that the Long type is not supported by XML-RPC (although I didn't know where to look in the docs to find that out), and that Apache xmlrpc throws an exception because of that. This is reasonable behaviour, and not what I was worried about. What bothers me is that is was very hard for me to figure out exactly what the error was without using a network sniffer. I think the response generator's exception handler should know if a response is already being written, and write the exception in such a format that is does not break the XML syntax, and the client can handle the error appropriately. Thanks for the link to the specification. It seems that the response cannot officially contain both a <fault> and a <params>, as this one attempts to do. However, to return the response as a <value><fault>...</fault></value>, while also violating the spec, would at least preserve valid XML structure, and allow the client a better chance to throw an appropriate exception, rather than a parse failure which disguises the true problem. Alternatively, I think it would be nice to detect this kind of malformed response in the client, and throw a more appropriate exception. Because of the difficulty of diagnosing such a problem (which must surely be a common programmer error) I'm -1 for leaving it untouched. I'm also very glad that this project is still alive, and hope I didn't ruffle any feathers. I was almost deterred from filing a bug report, and from future use of Apache xmlrpc, by the number and age of outstanding bugs. I wonder if there's some value in closing (with WONTFIX or UPGRADE) any bugs relating to xmlrpc version 1 which are fixed in version 2. This would make the bug tracker much less intimidating to newbies like me. By the way, http://ws.apache.org/xmlrpc/contributing.html links to an alternative issue tracker (Apache bugzilla). It confuses me that there are two alternative ways of tracking bugs, and I'm not a huge fan of Bugzilla, so perhaps that link should point to the JIRA bug tracker instead? Cheers, Chris. > Trying to serialise an unserialisable class breaks XML format spec > ------------------------------------------------------------------ > > Key: XMLRPC-71 > URL: http://issues.apache.org/jira/browse/XMLRPC-71 > Project: XML-RPC > Type: Bug > Components: Source > Versions: 2.0 > Environment: Linux (FC2 server, Suse 9.1 client), Java 1.4 on server, 1.5 on > client, Tomcat 4.1 on server > Reporter: Chris Wilson > > I tried to make a method return a vector containing a Hashtable containing a > Long, and invoke that method via XML-RPC (Apache XML-RPC on both client and > server). Here is the result (pasted from Ethereal, reformatted for > readability): > <?xml version="1.0" encoding="UTF-8"?> > <methodResponse> > <params> > <param><value><array><data> > <value><struct> > <member> > <name>version</name> > <value><int>2</int></value> > </member> > <member> > <name>name</name> > <value>UsingTomcatAtAidWorld</value> > </member> > <member> > <name>size</name> > <value> > <?xml version="1.0" encoding="UTF-8"?> > <methodResponse> > <fault><value><struct> > <member> > > <name>faultString</name> > > <value>java.lang.RuntimeException: unsupported Java type: class > java.lang.Long</value> > </member> > <member> > > <name>faultCode</name> > > <value><int>0</int></value> > </member> > </struct></value></fault> > </methodResponse> > This is malformed XML, and the client understandably takes a dim view of it: > Fatal error parsing XML: org.xml.sax.SAXParseException: unexpected end of > file found > org.apache.xmlrpc.XmlRpcClientException: Error decoding XML-RPC response > at > org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeResponse(XmlRpcClientResponseProcessor.java:78) > at > org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:72) > at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:193) > at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:173) > at > org.mahlen.hula.rpcclient.RPCClient.getRecentChanges(RPCClient.java:236) > Caused by: org.apache.xmlrpc.XmlRpcClientException: Error decoding XML-RPC > exception response > at > org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeException(XmlRpcClientResponseProcessor.java:109) > at > org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeResponse(XmlRpcClientResponseProcessor.java:69) > ... 9 more > Caused by: java.lang.NullPointerException > at > org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeException(XmlRpcClientResponseProcessor.java:102) > ... 10 more > By the way, is this project dead? There are outstanding issues over 3 years > old. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira