Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: SAAJ giving exception with large attachments

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    7
    My Mood
    Stressed
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default SAAJ giving exception with large attachments

    Hi,


    I'm using SAAJ at the server side to send SOAP message with attachments to the client. It works perfectly fine for attachments of size 10MB. But when I tried attaching a file of size 100 MB , its giving me the following exception:

    SEVERE: SAAJ0540: Error during saving a multipart message
    com.sun.xml.internal.messaging.saaj.SOAPExceptionI mpl: Error during saving a multipart message
    at com.sun.xml.internal.messaging.saaj.soap.MessageIm pl.writeTo(Unknown Source)
    at myPack.MyServer.doPost(MyServer.java:194)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:641)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:201)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:163)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:108)
    at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:556)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:401)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:242)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:267)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:245)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:260)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error
    at org.apache.catalina.connector.OutputBuffer.realWri teBytes(OutputBuffer.java:361)
    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(B yteChunk.java:437)
    at org.apache.tomcat.util.buf.ByteChunk.append(ByteCh unk.java:351)
    at org.apache.catalina.connector.OutputBuffer.writeBy tes(OutputBuffer.java:384)
    at org.apache.catalina.connector.OutputBuffer.write(O utputBuffer.java:373)
    at org.apache.catalina.connector.CoyoteOutputStream.w rite(CoyoteOutputStream.java:93)
    at javax.activation.DataHandler.writeTo(Unknown Source)
    at com.sun.xml.internal.messaging.saaj.packaging.mime .internet.MimeBodyPart.writeTo(Unknown Source)
    at com.sun.xml.internal.messaging.saaj.packaging.mime .internet.MimeMultipart.writeTo(Unknown Source)
    ... 20 more
    Caused by: java.net.SocketException: Connection reset by peer: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(Unknown Source)
    at java.net.SocketOutputStream.write(Unknown Source)
    at org.apache.coyote.http11.InternalOutputBuffer.real WriteBytes(InternalOutputBuffer.java:248)
    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(B yteChunk.java:437)
    at org.apache.tomcat.util.buf.ByteChunk.append(ByteCh unk.java:351)
    at org.apache.coyote.http11.InternalOutputBuffer$Outp utStreamOutputBuffer.doWrite(InternalOutputBuffer. java:272)
    at org.apache.coyote.http11.filters.ChunkedOutputFilt er.doWrite(ChunkedOutputFilter.java:126)
    at org.apache.coyote.http11.AbstractOutputBuffer.doWr ite(AbstractOutputBuffer.java:201)
    at org.apache.coyote.Response.doWrite(Response.java:5 60)
    at org.apache.catalina.connector.OutputBuffer.realWri teBytes(OutputBuffer.java:356)
    ... 28 more

    CAUSE:

    ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error
    at org.apache.catalina.connector.OutputBuffer.realWri teBytes(OutputBuffer.java:361)
    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(B yteChunk.java:437)
    at org.apache.tomcat.util.buf.ByteChunk.append(ByteCh unk.java:351)
    at org.apache.catalina.connector.OutputBuffer.writeBy tes(OutputBuffer.java:384)
    at org.apache.catalina.connector.OutputBuffer.write(O utputBuffer.java:373)
    at org.apache.catalina.connector.CoyoteOutputStream.w rite(CoyoteOutputStream.java:93)
    at javax.activation.DataHandler.writeTo(Unknown Source)
    at com.sun.xml.internal.messaging.saaj.packaging.mime .internet.MimeBodyPart.writeTo(Unknown Source)
    at com.sun.xml.internal.messaging.saaj.packaging.mime .internet.MimeMultipart.writeTo(Unknown Source)
    at com.sun.xml.internal.messaging.saaj.soap.MessageIm pl.writeTo(Unknown Source)
    at myPack.MyServer.doPost(MyServer.java:194)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:641)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:201)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:163)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:108)
    at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:556)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:401)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:242)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:267)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:245)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:260)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.SocketException: Connection reset by peer: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(Unknown Source)
    at java.net.SocketOutputStream.write(Unknown Source)
    at org.apache.coyote.http11.InternalOutputBuffer.real WriteBytes(InternalOutputBuffer.java:248)
    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(B yteChunk.java:437)
    at org.apache.tomcat.util.buf.ByteChunk.append(ByteCh unk.java:351)
    at org.apache.coyote.http11.InternalOutputBuffer$Outp utStreamOutputBuffer.doWrite(InternalOutputBuffer. java:272)
    at org.apache.coyote.http11.filters.ChunkedOutputFilt er.doWrite(ChunkedOutputFilter.java:126)
    at org.apache.coyote.http11.AbstractOutputBuffer.doWr ite(AbstractOutputBuffer.java:201)
    at org.apache.coyote.Response.doWrite(Response.java:5 60)
    at org.apache.catalina.connector.OutputBuffer.realWri teBytes(OutputBuffer.java:356)
    ... 28 more

    CAUSE:

    ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error
    at org.apache.catalina.connector.OutputBuffer.realWri teBytes(OutputBuffer.java:361)
    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(B yteChunk.java:437)
    at org.apache.tomcat.util.buf.ByteChunk.append(ByteCh unk.java:351)
    at org.apache.catalina.connector.OutputBuffer.writeBy tes(OutputBuffer.java:384)
    at org.apache.catalina.connector.OutputBuffer.write(O utputBuffer.java:373)
    at org.apache.catalina.connector.CoyoteOutputStream.w rite(CoyoteOutputStream.java:93)
    at javax.activation.DataHandler.writeTo(Unknown Source)
    at com.sun.xml.internal.messaging.saaj.packaging.mime .internet.MimeBodyPart.writeTo(Unknown Source)
    at com.sun.xml.internal.messaging.saaj.packaging.mime .internet.MimeMultipart.writeTo(Unknown Source)
    at com.sun.xml.internal.messaging.saaj.soap.MessageIm pl.writeTo(Unknown Source)
    at myPack.MyServer.doPost(MyServer.java:194)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:641)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:201)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:163)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:108)
    at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:556)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:401)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:242)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:267)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:245)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:260)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.SocketException: Connection reset by peer: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(Unknown Source)
    at java.net.SocketOutputStream.write(Unknown Source)
    at org.apache.coyote.http11.InternalOutputBuffer.real WriteBytes(InternalOutputBuffer.java:248)
    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(B yteChunk.java:437)
    at org.apache.tomcat.util.buf.ByteChunk.append(ByteCh unk.java:351)
    at org.apache.coyote.http11.InternalOutputBuffer$Outp utStreamOutputBuffer.doWrite(InternalOutputBuffer. java:272)
    at org.apache.coyote.http11.filters.ChunkedOutputFilt er.doWrite(ChunkedOutputFilter.java:126)
    at org.apache.coyote.http11.AbstractOutputBuffer.doWr ite(AbstractOutputBuffer.java:201)
    at org.apache.coyote.Response.doWrite(Response.java:5 60)
    at org.apache.catalina.connector.OutputBuffer.realWri teBytes(OutputBuffer.java:356)
    ... 28 more

    Please suggest a solution.

    Thanks in advance.

    Veronica.


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: SAAJ giving exception with large attachments

    Does this happen instantly or after a while?

    This could simply be caused by the fact that the transfer is taking some time and you might need to up your TTL or connection timeout somehow.

    // Json

  3. #3
    Junior Member
    Join Date
    Dec 2010
    Posts
    7
    My Mood
    Stressed
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: SAAJ giving exception with large attachments

    This happens instantly. Is there any constraint for the attachment size while using SAAJ?

    Thanks
    Veronica
    Last edited by Veronica; January 4th, 2011 at 04:16 AM.

Similar Threads

  1. Vector Addition with small numbers giving NaN
    By Zula in forum What's Wrong With My Code?
    Replies: 4
    Last Post: October 28th, 2010, 09:29 PM
  2. [SOLVED] Giving Java the name of a file to be read via command line?
    By lavloki in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: October 14th, 2010, 10:07 AM
  3. exception while Read very large file > 300 MB
    By ps.ganesh in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: June 11th, 2009, 11:39 PM