On 07/02/12 11:48, Viehmeier, Sven wrote:
Hi,

Thanks for your reply. It's a pity that this is not configurable at the moment 
since the timeout normally depends on the use case.
I tried to work around this by using the system property 
-Dsun.net.client.defaultReadTimeout but it did not change anything. Is there 
another property that could be used to change the read timeout value?

Please see
https://cwiki.apache.org/confluence/display/CXF/Distributed+OSGi+Reference,

DOSGi 1.3, just released, supports custom CXF interceptors.
So may be one option is to get the custom CXF out interceptor registered on the client side, and get this interceptor update HTTPConduit on every request or only once as needed, that should probably work, the thing I'm not sure about is what is the best way to get to the current Conduit from a current Message, definitely should be possible, does anyone know how to do it ?

This is the only thing I can think of for now...

Cheers, Sergey


A callback mechanism could be the last option but it would make the whole 
application very complex.

Sven

-----Original Message-----
From: Sergey Beryozkin [mailto:[email protected]]
Sent: 07 February 2012 11:30
To: [email protected]
Subject: Re: Distributed OSGi: Read timed out

Hi
On 07/02/12 10:13, Viehmeier, Sven wrote:
Hello,

I am building a distributed application using Distributed OSGi and Zookeeper. The 
application should run on Felix and Equinox. I register my services as JAX-WS 
webservices using BundleContext.registerService(...) and query them with a 
ServiceTracker<S,T>. So all service handling is done by the OSGi framework. 
Each service call does some calculations so it takes some time before responding to 
the caller.

The problem is that I get java.net.SocketTimeoutException: Read timed out 
exceptions when the service call takes more than 60 seconds. So it seems that 
there is a default timeout of 60 seconds. Does anybody know how I can configure 
the timeout that is used by the OSGi framework?

This is the full stack trace:

The actual invocation is managed by the CXF HTTP transport, so perhaps
the next release of DOSGI will need to support custom properties such as
org.apache.cxf.ws.http.readTimeout (and same for 'rs').

is there some Java HttpURLConnection specific system property that can
be used to control it in meantime ? Another option: what about
callbacks, with your client runtime also serving as a server, can that
work in your case ?

Sergey


Feb 06, 2012 11:27:02 AM org.apache.cxf.phase.PhaseInterceptorChain 
doDefaultLogging
WARNING: Interceptor for {http://test.com/}LB#{http://test.com/}createSession 
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
      at 
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
      at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:487)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
      at org.apache.cxf.frontend.ClientProxy.invoke(ClientProxy.java:68)
      at $Proxy34.createSession(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at 
org.apache.cxf.dosgi.dsw.handlers.ServiceInvocationHandler$1.run(ServiceInvocationHandler.java:65)
      at java.security.AccessController.doPrivileged(Native Method)
      at 
org.apache.cxf.dosgi.dsw.handlers.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:63)
      at $Proxy34.createSession(Unknown Source)
      at test.Consumer$LoadGeneratingThread.run(Consumer.java:122)
Caused by: java.net.SocketTimeoutException: SocketTimeoutException invoking 
http://192.168.0.15:9090/LB: Read timed out
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
      at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:2058)
      at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2043)
      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
      at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639)
      at 
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
      ... 16 more
Caused by: java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:150)
      at java.net.SocketInputStream.read(SocketInputStream.java:121)
      at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
      at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
      at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:641)
      at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:589)
      at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1319)
      at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
      at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2165)
      at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2134)
      at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1988)
      ... 19 more




Reply via email to