tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saurav Sarkar <saurav.sark...@gmail.com>
Subject Re: Default Max response size in Tomcat
Date Wed, 20 Mar 2019 11:08:17 GMT
Just to add the stack trace.

I am getting ClientAbortException "Connection reset by peer" when i am
trying to write to the response stream

2019-03-20T10:32:28.501+0000 [APP/PROC/WEB/0] ERR
org.apache.catalina.connector.ClientAbortException: java.io.IOException:
Connection reset by peer
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:364)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.connector.OutputBuffer.flushByteBuffer(OutputBuffer.java:833)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.connector.OutputBuffer.append(OutputBuffer.java:738)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:399)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:377)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:96)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.saurav.cpcftester.NetworkTester.doGet(NetworkTester.java:52)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:364)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:170)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
com.sap.xs.java.valves.ErrorReportValve.invoke(ErrorReportValve.java:66)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
com.sap.xs.security.UserInfoValve.invoke(UserInfoValve.java:19)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
com.sap.xs.statistics.tomcat.valve.RequestTracingValve.invoke(RequestTracingValve.java:43)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
com.sap.xs.logging.catalina.RuntimeInfoValve.invoke(RuntimeInfoValve.java:40)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:679)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
java.lang.Thread.run(Thread.java:836)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR Caused by:
java.io.IOException: Connection reset by peer
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
sun.nio.ch.FileDispatcherImpl.write0(Native Method)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:50)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
sun.nio.ch.IOUtil.write(IOUtil.java:65)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:478)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.tomcat.util.net.NioChannel.write(NioChannel.java:134)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:101)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:157)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.doWrite(NioEndpoint.java:1306)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.tomcat.util.net.SocketWrapperBase.doWrite(SocketWrapperBase.java:726)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.tomcat.util.net.SocketWrapperBase.writeBlocking(SocketWrapperBase.java:496)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.tomcat.util.net.SocketWrapperBase.write(SocketWrapperBase.java:434)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.coyote.http11.Http11OutputBuffer$SocketOutputBuffer.doWrite(Http11OutputBuffer.java:623)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:127)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.coyote.http11.Http11OutputBuffer.doWrite(Http11OutputBuffer.java:225)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.coyote.Response.doWrite(Response.java:602)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR at
org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:352)
2019-03-20T10:32:28.502+0000 [APP/PROC/WEB/0] ERR ... 39 more


On Wed, Mar 20, 2019 at 3:51 PM Saurav Sarkar <saurav.sarkar1@gmail.com>
wrote:

> Hi All
>
> I have a very basic test application which serves bytes from memory and
> gives it back to the client.
>
> Whenever i try to send the request for byte size which is of over 2 GB i
> get a connection reset error in my server code and a 502 error in my chrome
> console. Below 2 GB it is working fine.
>
> In my client side i execute java script which i execute from the browser.
> This basically executes an XMLHTTPRequest , gets the response (stores in
> browser memory) and asks for a save.
>
> I would like to know if there Is there max response size default value
> which is set in default tomcat configuration. ? or any other hints which
> you can provide in my use.
>
>
> Thanks and Regards,
>
> Saurav
>
> Below is the servlet or server side code
>
>
>
>         response.setContentLength((int)length);
>
>       }
>
>       else
>
>       {
>
>         response.addHeader("Content-Length", Long.toString(length));
>
>       }
>
>      // response.setContentLength(kByte * 1024);
>
>
>       ServletOutputStream outputStream = response.getOutputStream();
>
>       byte[] buffer = new byte[1024];
>
>       Random random = new Random(System.currentTimeMillis());
>
>
>       long size = 0;
>
>       while (size < kByte) {
>
>         random.nextBytes(buffer);
>
>         outputStream.write(buffer);
>
>         size += 1;
>
>       }
>
>
>       outputStream.flush();
>
>
>       return;
>
>     }
>
> }catch (Exception e) {
>
> e.printStackTrace();
>
> response.sendError(500, e.getMessage());
>
> return;
>
> }
>
>   }
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message