Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8196137

Error while writing base64 image data as part or request

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      other

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_141"
      Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.3.9600]


      A DESCRIPTION OF THE PROBLEM :
      Sending base64 image data as part of request URL.
      Ex: http://aa.aa.aa.aa:1111/abc?imageData=<base64data>

      When i am trying to send the attribute using BufferedReader getting the below exception

      BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream(),"UTF-8"));
      String line=null;
      while((line=in.readLine())!=null){
      response.append(line);
      }


      Exception:

      java.io.IOException: Error writing to server
      at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

      REGRESSION. Last worked in version 8u151

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_141"
      Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. In POST request url send one of the parameter as base64 data of image
      2. when trying to retrieve using Buffered class it is giving this exception

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      It should pass through buffered reader
      ACTUAL -
      java.io.IOException: Error writing to server
      at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.io.IOException: Error writing to server
      at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Not found any

      SUPPORT :
      YES

        Attachments

          Activity

            People

            • Assignee:
              psonal Pallavi Sonal (Inactive)
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: