Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java.net.ProtocolException: Bad Set-Cookie header while try to get getInputStream  RSS feed

 
Niklesh Mudiraj
Greenhorn
Posts: 12
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hii,

Following is the exception log. I am getting the java.net.ProtocolException: Bad Set-Cookie header on last line in below code snapshot .

java.net.ProtocolException: Bad Set-Cookie header: f5avrbbbbbbbbbbbbbbbb=GDDJHKCJKDIPFLIEIANLNJKDFNLAKNGLMJFJIKLJEKIDCDKIEKHHCLAMGOMAFMBODNEFHJNDJFHPAPDMJLPEKPBFBABLOHHCIIGBDBKDLIINLCIECOKFKLBPJPGOLIMH; HttpOnly; secure
No '=' found for token starting at position 152
at HTTPClient.Cookie.parse(Cookie.java:181)
at HTTPClient.CookieModule.handleCookie(CookieModule.java:442)
at HTTPClient.CookieModule.responsePhase1Handler(CookieModule.java:391)
at HTTPClient.HTTPResponse.handleResponse(HTTPResponse.java:623)
at HTTPClient.HTTPResponse.getInputStream(HTTPResponse.java:515)
at HTTPClient.HttpURLConnection.getInputStream(HttpURLConnection.java:481)


Code Snapshot :

java.net.HttpURLConnection connjava;
java.net.URL url;
url = new java.net.URL(url1);
connjava = (java.net.HttpURLConnection)url.openConnection();
connjava.setRequestMethod("POST");
connjava.setRequestProperty("Content-Length", "" + Integer.toString(xml.getBytes().length));
connjava.setRequestProperty("Content-Language", "en-US");
connjava.setRequestProperty("Content-Type", "text/xml; charset=utf-8");
connjava.setDoInput(true);
connjava.setDoOutput(true);
connjava.setUseCaches(false);
connjava.setAllowUserInteraction(true);
/*connjava.setReadTimeout(0);
connjava.setConnectTimeout(0);*/
System.out.println("Request Send ");
java.io.DataOutputStream printout = new java.io.DataOutputStream (connjava.getOutputStream());
printout.writeBytes(xml);
setRequestDate(XMLRequestParam.getSysDate(request));
printout.flush();
printout.close();

String resp="";
java.io.BufferedReader in = new java.io.BufferedReader(new java.io.InputStreamReader(connjava.getInputStream()));

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!