You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@ws.apache.org by Andreas Schlicker <sc...@mpi-inf.mpg.de> on 2005/12/29 14:43:26 UTC

XMLRPC client problem with long requests

Hi all,

I'm using xmlrpc-2.0 with Java 1.5.0 (I think update 5). I have a 
problem with long requests.

My Java client implementation calls a dummy PHP script that waits for 
some time and then returns the start and end times using XMLRPC.
This works perfectly fine if the script waits for up to 5 minutes.

The debug output from a successful call is:

Created client to url space 
http://bioinf.mpi-sb.mpg.de/projects/gotax/wait.php
Unable to determine the value of the system property 
'org.apache.xmlrpc.TypeFactory': access denied 
(java.util.PropertyPermission org.apache.xmlrpc.TypeFactory read)
Beginning parsing XML input stream
startElement: methodResponse
startElement: params
startElement: param
startElement: value
startElement: string
endElement: string
endElement: value
endElement: param
endElement: params
endElement: methodResponse
Spent 12 millis parsing
Spent 150 millis in request/process/response


However, the real application I'm interested in will take probably some 
hours. If the PHP script waits longer than five minutes I get the 
following error from XmlRpcClient with debug set to true:

Created client to url space 
http://bioinf.mpi-sb.mpg.de/projects/gotax/wait.php
Unable to determine the value of the system property 
'org.apache.xmlrpc.TypeFactory': access denied 
(java.util.PropertyPermission org.apache.xmlrpc.TypeFactory read)
Spent 803665 millis in request/process/response
Avoiding obscuring previous error by supressing error encountered while 
ending request: org.apache.xmlrpc.XmlRpcClientException: Exception 
closing URLConnection
Unexpected end of file from server
java.net.SocketException: Unexpected end of file from server
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:684)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:554)
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:682)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:554)
	at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:936)
	at org.apache.xmlrpc.DefaultXmlRpcTransport.sendXmlRpc(Unknown Source)
	at org.apache.xmlrpc.XmlRpcClientWorker.execute(Unknown Source)
	at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
	at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
	at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
	at gotaxexplorer.client.Runner.run(Runner.java:61)


The XmlRpcClientLite throws this exception:
XmlRpcClientLite:
Server returned invalid Response.
java.io.IOException: Server returned invalid Response.
	at org.apache.xmlrpc.LiteXmlRpcTransport.sendRequest(Unknown Source)
	at org.apache.xmlrpc.LiteXmlRpcTransport.sendXmlRpc(Unknown Source)
	at org.apache.xmlrpc.XmlRpcClientWorker.execute(Unknown Source)
	at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
	at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
	at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
	at gotaxexplorer.client.Runner.run(Runner.java:60)


Here is the client code I use:

XmlRpc.setKeepAlive(true);
XmlRpc.setDebug(true);
XmlRpcClient xml = new XmlRpcClient(url);
Vector params = new Vector(2);
params.addElement(query);
params.addElement(param);
Object result = xml.execute(method,  params);

Does anyone have an idea?

Thanks in advance.
Andreas

Re: XMLRPC client problem with long requests

Posted by Adam Taft <ad...@hydroblaster.com>.
PHP has a maximum time which a script can run.  If it goes beyond this, 
it closes the connection.  I think it might drop an error too, but it's 
just a traditional PHP html output error, not an xmlrpc exception.

http://us3.php.net/manual/en/function.set-time-limit.php

Remember, XMLRPC is HTTP.  You should be able to use a web browser to 
check that your xmlrpc script is running and at least giving a standard 
xmlrpc exception.  When running a PHP server, you may not actually see 
any results in your xmlrpc client if your PHP server script is running 
poorly.


Andreas Schlicker wrote:
> Hi all,
> 
> I'm using xmlrpc-2.0 with Java 1.5.0 (I think update 5). I have a 
> problem with long requests.
> 
> My Java client implementation calls a dummy PHP script that waits for 
> some time and then returns the start and end times using XMLRPC.
> This works perfectly fine if the script waits for up to 5 minutes.
> 
> The debug output from a successful call is:
> 
> Created client to url space 
> http://bioinf.mpi-sb.mpg.de/projects/gotax/wait.php
> Unable to determine the value of the system property 
> 'org.apache.xmlrpc.TypeFactory': access denied 
> (java.util.PropertyPermission org.apache.xmlrpc.TypeFactory read)
> Beginning parsing XML input stream
> startElement: methodResponse
> startElement: params
> startElement: param
> startElement: value
> startElement: string
> endElement: string
> endElement: value
> endElement: param
> endElement: params
> endElement: methodResponse
> Spent 12 millis parsing
> Spent 150 millis in request/process/response
> 
> 
> However, the real application I'm interested in will take probably some 
> hours. If the PHP script waits longer than five minutes I get the 
> following error from XmlRpcClient with debug set to true:
> 
> Created client to url space 
> http://bioinf.mpi-sb.mpg.de/projects/gotax/wait.php
> Unable to determine the value of the system property 
> 'org.apache.xmlrpc.TypeFactory': access denied 
> (java.util.PropertyPermission org.apache.xmlrpc.TypeFactory read)
> Spent 803665 millis in request/process/response
> Avoiding obscuring previous error by supressing error encountered while 
> ending request: org.apache.xmlrpc.XmlRpcClientException: Exception 
> closing URLConnection
> Unexpected end of file from server
> java.net.SocketException: Unexpected end of file from server
>     at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:684)
>     at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:554)
>     at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:682)
>     at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:554)
>     at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:936) 
> 
>     at org.apache.xmlrpc.DefaultXmlRpcTransport.sendXmlRpc(Unknown Source)
>     at org.apache.xmlrpc.XmlRpcClientWorker.execute(Unknown Source)
>     at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
>     at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
>     at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
>     at gotaxexplorer.client.Runner.run(Runner.java:61)
> 
> 
> The XmlRpcClientLite throws this exception:
> XmlRpcClientLite:
> Server returned invalid Response.
> java.io.IOException: Server returned invalid Response.
>     at org.apache.xmlrpc.LiteXmlRpcTransport.sendRequest(Unknown Source)
>     at org.apache.xmlrpc.LiteXmlRpcTransport.sendXmlRpc(Unknown Source)
>     at org.apache.xmlrpc.XmlRpcClientWorker.execute(Unknown Source)
>     at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
>     at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
>     at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
>     at gotaxexplorer.client.Runner.run(Runner.java:60)
> 
> 
> Here is the client code I use:
> 
> XmlRpc.setKeepAlive(true);
> XmlRpc.setDebug(true);
> XmlRpcClient xml = new XmlRpcClient(url);
> Vector params = new Vector(2);
> params.addElement(query);
> params.addElement(param);
> Object result = xml.execute(method,  params);
> 
> Does anyone have an idea?
> 
> Thanks in advance.
> Andreas
>