When developing web PDF printing Today, the servlet encounters a problem when writing data to the client:
Caused by: clientabortexception: java.net.socketexception: software caused connection abort: socket write errorat Org.apache.catalina.connector.OutputBuffer.realWriteBytes (outputbuffer.java:406) at Org.apache.tomcat.util.buf.ByteChunk.flushBuffer (bytechunk.java:480) at Org.apache.tomcat.util.buf.ByteChunk.append (bytechunk.java:310) at Org.apache.catalina.connector.OutputBuffer.writeByte (outputbuffer.java:450) at Org.apache.catalina.connector.CoyoteOutputStream.write (coyoteoutputstream.java:77) at Com.cnpc.print.PrintServlet.doPost (printservlet.java:83) ... 25 morecaused by: java.net.socketexception: software caused connection abort: socket write Errorat java.net.socketoutputstream.socketwrite0 (Native method) at Java.net.SocketOutputStream.socketWrite (socketoutputstream.java:113) At java.net.socketoutputstream.write ( Socketoutputstream.java:159) at org.apache.coyote.http11.internaloutputbuffer.realwritebytes (InternalOutputBuffer.java:215) at org.apache.tomcat.util.buf.bytechunk.flushbuffer (bytechunk.java:480) at Org.apache.tomcat.util.buf.ByteChunk.append (bytechunk.java:366) at Org.apache.coyote.http11.internaloutputbuffer$outputstreamoutputbuffer.dowrite (InternalOutputBuffer.java:240) At org.apache.coyote.http11.filters.chunkedoutputfilter.dowrite (chunkedoutputfilter.java:119) at Org.apache.coyote.http11.AbstractOutputBuffer.doWrite (abstractoutputbuffer.java:192) at Org.apache.coyote.Response.doWrite (response.java:517) at Org.apache.catalina.connector.OutputBuffer.realWriteBytes (outputbuffer.java:401) ... 30 more
Phenomenon is, tick 6 rows of data, point printing will not respond, the window is turned off, the server background report above the error, tick 5 rows of data There is no problem, suspect several places may have problems:
There is a problem with the PDF data when writing PDF data to the socket. (Do not write to the socket, changed to write files, the contents of the file is normal, excluded.) )
When a page requests a PDF, it uses the Layer.js iframe pop-up window, and the URL parameter is too long to check when multiple rows are selected. (instead of the pop-up window after the execution of a JS submission form, the parameters placed in the form, or error, exclusion.) )
There is a problem with IE opening the PDF stream. (instead of downloading the file form, the problem persists.) Exclude. )
Finally, the discovery is the problem 2. The original is to check the data of all the column sequence into JSON after the background, instead of only the ID column, the data reduced a lot, no problem, but clearly I ruled out, do not understand, rely on.
This article is from the "some" blog, be sure to keep this source http://2924037.blog.51cto.com/2914037/1583865
Clientabortexception. Socket Write Error problem