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




--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to