Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

URLConnection.getInputStream() - "Invalid HttpResponse" Exception JRE-1.7.0

883419Aug 22 2011 — edited Sep 7 2011
The following code is throwing "java.io.IOException: Invalid Http response" when executed with few URLs in JRE 7.0

URL launchUrl = new URL("http://<URL>");
URLConnection uConn = launchUrl.openConnection();
uConn.getInputStream(); //The exception is thrown here

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at URLTest.main(URLTest.java:9)

The same code works fine when run from JRE 1.6.0_12.
The way java handles http request/response changed in JDK 7.0?
I the particular URL that is not working is present in GoAhead Webserver.
This post has been answered by 880401 on Aug 29 2011
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 5 2011
Added on Aug 22 2011
6 comments
23,055 views