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 "Chris Wilson (JIRA)" <xm...@ws.apache.org> on 2005/10/16 02:26:45 UTC

[jira] Created: (XMLRPC-71) Trying to serialise an unserialisable class breaks XML format spec

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


[jira] Kommentiert: (XMLRPC-71) Trying to serialise an unserialisable class breaks XML format spec

Posted by "Jochen Wiedmann (JIRA)" <xm...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLRPC-71?page=comments#action_12332175 ] 

Jochen Wiedmann commented on XMLRPC-71:
---------------------------------------


I admit, that I can see a point in your suggestion to have the response parseable. On the other hand, I see a good chance, that most XML-RPC clients would silently ignore the error message. IMO, that's even worse?


> 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


[jira] Assigned: (XMLRPC-71) Trying to serialise an unserialisable class breaks XML format spec

Posted by "Jochen Wiedmann (JIRA)" <xm...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLRPC-71?page=all ]

Jochen Wiedmann reassigned XMLRPC-71:
-------------------------------------

    Assign To: Jochen Wiedmann

> 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
>     Assignee: Jochen Wiedmann

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


[jira] Commented: (XMLRPC-71) Trying to serialise an unserialisable class breaks XML format spec

Posted by "Chris Wilson (JIRA)" <xm...@ws.apache.org>.
    [ 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


[jira] Commented: (XMLRPC-71) Trying to serialise an unserialisable class breaks XML format spec

Posted by "Chris Wilson (JIRA)" <xm...@ws.apache.org>.
    [ 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


[jira] Kommentiert: (XMLRPC-71) Trying to serialise an unserialisable class breaks XML format spec

Posted by "Jochen Wiedmann (JIRA)" <xm...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLRPC-71?page=comments#action_12361422 ] 

Jochen Wiedmann commented on XMLRPC-71:
---------------------------------------

I was looking through the sources today, and I could not think of a way how this problem might arise.

Here's what I do see:

- The XmlRpcResponseProcessor's encodeResponse method is called. It fails, because
  of the invalid object in the Hashmap. An exception is being thrown.
- Nothing is written to the output stream yet.
- The exception is catched in the XmlRpcWorker's execute method. The XmlRpcResponseProcessor's
  encodeException is called. This should work fine and the error message is being written.



> 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


[jira] Kommentiert: (XMLRPC-71) Trying to serialise an unserialisable class breaks XML format spec

Posted by "Jochen Wiedmann (JIRA)" <xm...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLRPC-71?page=comments#action_12332173 ] 

Jochen Wiedmann commented on XMLRPC-71:
---------------------------------------

First of all, the error message is absolutely right: The long type is unsupported. Even more: Supporting it would violate the XML-RPC spec. (See http://www.xmlrpc.com/spec)

To me, it is very questionable, whether we should attempt to fix this issue. The XML-RPC callee is responsible for returning a valid result object. (Which you did not.) I think it is reasonable, to trust that he did and not verifying the result.

On the other hand, without verifying the result, we could either decide to write the response into a temporary buffer (a clear performance problem for applications with large result objects) or take the risk to create a malformed response. The latter is exactly how it is now. I am +1 for leaving it that way.

If you absolutely need support for longs, you might try to use the streaming branch (http://svn.apache.org/viewcvs.cgi/webservices/xmlrpc/branches/b20050512_streaming/).

FInally, as you see from my response, this project isn't dead at all. The bug reports you are referring to are filed for version 1 of XML-RPC, which is (afaik) no longer supported.


> 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