cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: read timeouts in JAX-RS function
Date Thu, 12 May 2011 09:58:53 GMT
Hi Benson

I think if you do webClient.post(payload) and exit immediately,
without check the response, then may be the client runtime closes the
streams too early.
May be you just need to configurea couple of timeouts,
HttpClientPolicy config =
WebClient.getConfig(webClient).getHttpConduit().getClient();
config.setReceiveTimeout(10000);
config.setConnectionTimeout(10000);

How is this issue for sending large attachments/payloads resolved in
JAXWS case ?

Hope that helps.
Sergey

On Wed, May 11, 2011 at 7:53 PM, Benson Margulies <bimargulies@gmail.com> wrote:
> CXF 2.4.0. I have a JAX-RS method that accepts a POST of type
> application/json. I've written the function to take an InputStream as
> an argument.
>
> Every so often, it fails with a read time-out. The client passes the
> entire contents of the posted json in the post call, so I don't see
> where pauses would come from.
>
> I do wonder if the client is somehow leaking streams. When I call
> WebClient.post, what is my responsibility for closing and stream in
> the Response?
>
> 2011-05-11 14:50:14,613 [http-9167-1] WARN
> com.basistech.lsh.service.UploadService - IO Error reading json
> java.net.SocketTimeoutException: Read timed out
>        at java.net.SocketInputStream.socketRead0(Native Method)
>        at java.net.SocketInputStream.read(SocketInputStream.java:129)
>        at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:751)
>        at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:781)
>        at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116)
>        at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:710)
>        at org.apache.coyote.Request.doRead(Request.java:428)
>        at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:304)
>        at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:403)
>        at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:327)
>        at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193)
>        at java.io.FilterInputStream.read(FilterInputStream.java:116)
>        at org.codehaus.jackson.impl.ByteSourceBootstrapper.ensureLoaded(ByteSourceBootstrapper.java:340)
>        at org.codehaus.jackson.impl.ByteSourceBootstrapper.detectEncoding(ByteSourceBootstrapper.java:116)
>        at org.codehaus.jackson.impl.ByteSourceBootstrapper.constructParser(ByteSourceBootstrapper.java:197)
>        at org.codehaus.jackson.JsonFactory._createJsonParser(JsonFactory.java:542)
>        at org.codehaus.jackson.JsonFactory.createJsonParser(JsonFactory.java:389)
>        at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1448)
>        at com.basistech.lsh.service.UploadService.upload(UploadService.java:92)
>        at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
>        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
>        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:162)
>        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:89)
>        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
>        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>        at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
>        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
>        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
>        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:118)
>        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:208)
>        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
>        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:166)
>        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:113)
>        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:184)
>        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:107)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:163)
>        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
>        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
>        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
>        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>        at java.lang.Thread.run(Thread.java:680)
>



-- 
Sergey Beryozkin

Application Integration Division of Talend
http://sberyozkin.blogspot.com

Mime
View raw message