[ http://issues.apache.org/jira/browse/XMLRPC-71?page=comments#action_12332176 ]
Chris Wilson commented on XMLRPC-71: ------------------------------------ Hi Jochen, Is it possible to scan all the response values to see if they are serialisable or not, before beginning to send the response? If so, that seems like the best option to me. Or maybe the client should report the invalid XML if parsing fails? That would also help with debugging. 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