Results 1 to 3 of 3
  1. #1
    m.arif is offline Member
    Join Date
    Jan 2009
    Posts
    1
    Rep Power
    0

    Exclamation ClientAbortException: java.net.SocketException:Software caused connection abort:

    I have problem while sending the data on mobile client. This is happing when I sending file(audio, image or video) of size 2 or more MB.
    The exact exception is here


    INFO 07 Jan 2009 13:20:03,562 (DownlaoderServlet.java:77) - fie size 1737743
    INFO 07 Jan 2009 13:20:03,593 (DownlaoderServlet.java:87) - error in writing file on stream
    ClientAbortException: java.net.SocketException: Software caused connection abort: socket write error
    at org.apache.catalina.connector.OutputBuffer.realWri teBytes(OutputBuffer.java:366)
    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(B yteChunk.java:403)
    at org.apache.tomcat.util.buf.ByteChunk.append(ByteCh unk.java:323)
    at org.apache.catalina.connector.OutputBuffer.writeBy tes(OutputBuffer.java:392)
    at org.apache.catalina.connector.OutputBuffer.write(O utputBuffer.java:381)
    at org.apache.catalina.connector.CoyoteOutputStream.w rite(CoyoteOutputStream.java:76)
    at java.util.zip.DeflaterOutputStream.deflate(Deflate rOutputStream.java:156)
    at java.util.zip.DeflaterOutputStream.write(DeflaterO utputStream.java:114)
    at java.util.zip.GZIPOutputStream.write(GZIPOutputStr eam.java:72)
    at java.io.FilterOutputStream.write(FilterOutputStrea m.java:80)
    at com.tcm.autumn.servlets.DownlaoderServlet.doGet(Do wnlaoderServlet.java:81)
    at com.tcm.autumn.servlets.DownlaoderServlet.doPost(D ownlaoderServlet.java:110)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:672)




    if file size is less then the 2MB then file send successfully. Sir can you help me in this type of error. File reading and sending code is here.


    try{

    byte[] fileInArray = null;
    fileInArray = readFileByte(fileUrl);
    OutputStream outStream = new GZIPOutputStream(response.getOutputStream());
    output.write(fileInArray); // got exception here

    outStream.flush();
    outStream.close();
    }catch(Exception e){

    }



    public static byte[] readFileByte(String filePath) throws FileNotFoundException, IOException
    {
    FileInputStream fileInputStream = null;
    byte[] contentByte = null;
    File contentFile = new File(filePath);
    int contentSize = (int) contentFile.length();
    fileInputStream = new FileInputStream(contentFile);

    contentByte = new byte[contentSize];
    fileInputStream.read(contentByte);

    fileInputStream.close();
    return contentByte;
    }

  2. #2
    hemanta is offline Member
    Join Date
    Jan 2009
    Posts
    2
    Rep Power
    0

    Default Hello

    Hello everyone.....

  3. #3
    peppem is offline Member
    Join Date
    Jan 2009
    Location
    italy
    Posts
    16
    Rep Power
    0

    Default

    The problem occur every time the filesize exceed 2MB?

    The problem must be in client side: probabily the client for some reason interrupts the communication with server causing the exception
    Article and examples about Java EE world
    http://programmaremobile.blogspot.com

Similar Threads

  1. Replies: 3
    Last Post: 05-22-2011, 03:16 PM
  2. Replies: 7
    Last Post: 06-08-2010, 01:36 PM
  3. Replies: 3
    Last Post: 04-13-2010, 03:43 PM
  4. Replies: 5
    Last Post: 03-13-2009, 12:45 PM
  5. Ftpclient abort download
    By Papalazarou in forum New To Java
    Replies: 0
    Last Post: 01-06-2009, 04:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •