Hi
On 08/11/11 10:13, [email protected] wrote:
Hi ,
This is my Method code shown below
Actually this serves as a Webservices Method .
*public Response getData(ServiceRequest request)
{
try
{
final boolean toProceedorNot = validate(legdata);
if (!toProceedorNot) {
status.setErrorText(errorText);
return response;
}
else {
// Some Processing is done here
response.setMessage(result);
}
}
catch(Exception e)
{
errorText = e.getMessage().toString();
status.setErrorText(errorText);
response.setStatus(status);
}
return response;
}*
If the execution of the Method takes longer time , an SocketTimeoutException
will be thrown by the Apache CXF Framework
* at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:695)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:640)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
at
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2034)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2013)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1938)
at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at
org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:626)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)*
You can configure HttpConduit with a receiveTimeout property...
My Question is that , even though an SocketTimeoutException is thrown , it
is not coming inside the Exception block .
Is it for a SOAP client ? Is it completely escaping the exception block,
that is strange, please provide info and may be we can spot something
Sergey
I am not sure whether this Exception , should be handled by whom ( The
client or inside the Webservices Implementation method )
*But as a Webservice provider , please tell me how to deal with this
Exception ??*
Thanks
--
View this message in context:
http://cxf.547215.n5.nabble.com/How-to-deal-with-SocketTimeoutException-inside-Java-Code-Webservices-tp4973805p4973805.html
Sent from the cxf-user mailing list archive at Nabble.com.