WLS 10.3.1 - [java.io.IOException: failed to read '2' bytes from InputStream; clen] -Fileservlet Does Not Deliver Full Files (Doc ID 1374049.1)

Last updated on JUNE 09, 2016

Applies to:

Oracle WebLogic Server - Version 10.3.1 and later
Information in this document applies to any platform.

Symptoms

FileServlet either returned files that are chopped off or returned the following error:
java.io.IOException: failed to read '20' bytes from InputStream; clen: 208411 remaining: 20 count: 719


The entire stack trace is the following


java.io.IOException: failed to read '2' bytes from InputStream; clen: 208423 remaining: 2 count: 3701
at weblogic.servlet.internal.ChunkOutput.writeStream(ChunkOutput.java:417)
at weblogic.servlet.internal.ChunkOutputWrapper.writeStream(ChunkOutputWrapper.java:178)
at weblogic.servlet.internal.ServletOutputStreamImpl.writeStream(ServletOutputStreamImpl.java:523)
at weblogic.servlet.internal.ServletOutputStreamImpl.writeStream(ServletOutputStreamImpl.java:511)
at weblogic.servlet.FileServlet.sendFile(FileServlet.java:410)
at weblogic.servlet.FileServlet.doGetHeadPost(FileServlet.java:234)
at weblogic.servlet.FileServlet.service(FileServlet.java:173)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:499)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:248)
at com.lehman.live.app.servlets.PassThruServlet.etgService(PassThruServlet.java:86)
at com.lehman.admin.servlet.EtgAdminHttpServlet.execute(EtgAdminHttpServlet.java:661)
at com.lehman.live.servlet.LLiveHttpServlet.execute(LLiveHttpServlet.java:326)
at com.lehman.live.servlet.ServletDispatcher.executeServlet(ServletDispatcher.java:422)
at com.lehman.live.servlet.ServletDispatcher.dispatch(ServletDispatcher.java:211)
at com.lehman.live.servlet.LLiveHttpServlet.etgDispatch(LLiveHttpServlet.java:273)
at com.lehman.admin.servlet.EtgAdminHttpServlet.service(EtgAdminHttpServlet.java:270)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)


Solution in such scenario's is to set the "resource-reload-check-secs" parameter to "0," so that WLS always reloads the latest updated file.

and increasing Chunksize parameter -Dweblogic.Chunksize=XXXX

However having both of above settings did not help.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms