https://issues.apache.org/bugzilla/show_bug.cgi?id=55976
Ognjen Blagojevic <ognjen.d.blagoje...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- OS| |All --- Comment #1 from Ognjen Blagojevic <ognjen.d.blagoje...@gmail.com> --- Java client is used for smoke testing Tomcat 7.0.50. Java client fails with following exception: ==== Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Invalid Http response at webcrawler.WebCrawler.getpage(WebCrawler.java:117) at webcrawler.WebCrawler.repeat(WebCrawler.java:191) at webcrawler.WebCrawler.main(WebCrawler.java:30) Caused by: java.io.IOException: Invalid Http response at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1342) at java.net.URL.openStream(URL.java:1037) at webcrawler.WebCrawler.getpage(WebCrawler.java:94) ... 2 more ---- Relevant lines from sun.net.www.protocol.http.HttURLConnection.getInputStream: ==== respCode = getResponseCode(); if (respCode == -1) { disconnectInternal(); throw new IOException ("Invalid Http response"); } ---- So, getResponseCode returns -1. Relevant part from sun.net.www.protocol.http.HttURLConnection.getResponseCode(): ==== /* * Examine the status-line - should be formatted as per * section 6.1 of RFC 2616 :- * * Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase * * If status line can't be parsed return -1. */ if (statusLine.startsWith("HTTP/1.")) { int codePos = statusLine.indexOf(' '); if (codePos > 0) { int phrasePos = statusLine.indexOf(' ', codePos+1); if (phrasePos > 0 && phrasePos < statusLine.length()) { responseMessage = statusLine.substring(phrasePos+1); } // deviation from RFC 2616 - don't reject status line // if SP Reason-Phrase is not included. if (phrasePos < 0) phrasePos = statusLine.length(); try { responseCode = Integer.parseInt (statusLine.substring(codePos+1, phrasePos)); return responseCode; } catch (NumberFormatException e) { } } } return -1; ---- So it seems that response from Tomcat doesn't contain string "HTTP/1." in the first line. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org