Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!goblin1!goblin2!goblin.stu.neva.ru!newsfeed1.swip.net!85.214.130.194.MISMATCH!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED.host86-130-209-124.range86-130.btcentralplus.com!not-for-mail From: Steven Simpson Newsgroups: comp.lang.java.programmer Subject: Re: JAVA Networking: Code with getInputStream() was compatible with Java 1.6, is but anymore with 1.7 Date: Sun, 31 Mar 2013 00:00:02 +0000 Organization: A noiseless patient Spider Lines: 16 Message-ID: <2tak2a-35n.ln1@s.simpson148.btinternet.com> References: <042eb983-7952-46e4-8002-2eb5c8ff9323@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: mx05.eternal-september.org; posting-host="host86-130-209-124.range86-130.btcentralplus.com:86.130.209.124"; logging-data="2071"; mail-complaints-to="abuse@eternal-september.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 In-Reply-To: <042eb983-7952-46e4-8002-2eb5c8ff9323@googlegroups.com> Xref: csiph.com comp.lang.java.programmer:23170 On 30/03/13 21:22, musart wrote: > I have a piece of software which establishes a communication between a PC and a machine, which used to work in Java 1.6, but doesn't anymore in 1.7. The IOException --> "Invalid Http response" is what I get as soon as the getInputStream() method is called. It seems like the method had been improved an is much more sensitive, meaning that responseCode=-1 result is not specifically checked in Java 1.6. > > Assited with Wireshark I checked if both versions (1.6 & 1.7) sent and received same Ethernet frames, and so did both. Get the menu on one of the HTTP-carrying frames, and select "Follow TCP Stream". What is the result? Does it look like a proper HTTP exchange? I would suggest calling getErrorStream() if you get an exception from getInputStream(), but if the response does not appear to be valid HTTP, I can't predict what getErrorStream() will actually give you. -- ss at comp dot lancs dot ac dot uk