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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Possible bug in Java 7

user8478974Nov 12 2011 — edited Jun 6 2012
If I run the following code in Java 6, there is no problem. If I run it in Java 7, the it hangs after reading and printing parts of the page.

I have posted a bug report, but the bug is closed because they are not able to reproduce the bug (see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7045092).

I am wondering if anyone else gets a problem when running the code.

import java.io.*;
import java.net.URL;

public class HttpReaderBug {

    public static void main(String[] args) {
        try {
            URL url = new URL("http://en.wikipedia.org/wiki/Cancer");
            BufferedReader in = new BufferedReader(
                    new InputStreamReader(url.openStream()));
            String line;
            while ((line = in.readLine()) != null) {
                System.out.println(line);
            }
            in.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }
}

Comments

tschodt
user8478974 wrote:
import java.io.*;
import java.net.URL;

public class HttpReaderBug {

public static void main(String[] args) {
try {
URL url = new URL("http://en.wikipedia.org/wiki/Cancer");
BufferedReader in = new BufferedReader(
new InputStreamReader(url.openStream()));
String line;
while ((line = in.readLine()) != null) {
System.out.println(line);
}
in.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
If what reaches you from http://en.wikipedia.org/wiki/Cancer
does not end with "\n" or "\r" or "\r\n" [url http://download.oracle.com/javase/6/docs/api/java/io/BufferedReader.html#readLine%28%29]BufferedReader.readLine() will possibly appear to hang.
Try reading bytes and process CR-LF yourself.
EJP
I am wondering if anyone else gets a problem when running the code.
Cannot reproduce. I got all the way to the </html>.
user8478974
Thanks for trying. I've tried the code using different ISPs and the problem is still there. May-be it has something to do with my computer, the network drivers, protocol stack implementation, or something. The strange thing is that this does not happen when I use Java 6, or when I use other software such as a web browser.
gimbal2
Perhaps the problem is in a specific OS release of Java 7. Which are you using? Windows? Linux? 32 bits version? 64 bits version?
user8478974
Windows 7, 64-bit. Microsoft Windows [Version 6.1.7601] Dell Inspiron 1470,
user8478974
Regarding the Java version:

java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b139)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b09, mixed mode)
EJP
Update it, don't use an EA (Early Availability). Mine:
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)
user8478974
I updated the jre and tried again. I still have the same problem. I have tried different variants; reading bytes instead of lines, with and without buffering. I manage to read 200-400 lines, and then the program hangs.

java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode)
810618
I guess I would first set a read timeout to tell you for sure that the 'hang' is actually a block on the read (as opposed to the program just going off into never-never land for whatever reason). If you see that it is blocking on the read, take a look at the exchange with a packet sniffer. It might give you a clue as to what is (not) happening when the hang occurs.
user8478974
So I installed a packet sniffer (Wireshark) as recommended:

Here is the output:
No. Time Source Destination Protocol Length Info
9592 1831.904428 192.168.1.72 208.80.152.201 HTTP 220 GET /wiki/Cancer HTTP/1.1
9593 1832.021517 208.80.152.201 192.168.1.72 TCP 54 http > 54605 [ACK] Seq=1 Ack=167 Win=7168 Len=0
9594 1832.023259 208.80.152.201 192.168.1.72 TCP 596 [TCP segment of a reassembled PDU]
9595 1832.023657 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9596 1832.023721 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=2003 Win=17520 Len=0
9597 1832.024407 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9598 1832.048324 192.168.1.72 173.194.64.102 TCP 54 54604 > http [ACK] Seq=3519 Ack=2988 Win=15852 Len=0
9599 1832.140566 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9600 1832.140708 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=4923 Win=17520 Len=0
9601 1832.141305 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9602 1832.141353 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9603 1832.141398 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=7843 Win=17520 Len=0
9604 1832.256844 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9605 1832.257179 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9606 1832.257215 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=10763 Win=17520 Len=0
9607 1832.257826 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9608 1832.258516 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9609 1832.258541 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=13683 Win=17520 Len=0
9610 1832.258833 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9611 1832.259546 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9612 1832.259570 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=16603 Win=17520 Len=0
9613 1832.374031 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9614 1832.374442 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9615 1832.374492 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=19523 Win=17520 Len=0
9616 1832.375112 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9617 1832.375888 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9618 1832.375950 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=22443 Win=17520 Len=0
9619 1832.376352 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9620 1832.377436 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9621 1832.377490 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=25363 Win=17520 Len=0
9622 1832.378318 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9623 1832.380923 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9624 1832.380981 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=28283 Win=17520 Len=0
9625 1832.385363 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9626 1832.495029 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9627 1832.495089 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=31203 Win=17520 Len=0
9628 1832.495418 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9629 1832.495752 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9630 1832.495775 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=34123 Win=17520 Len=0
9631 1832.496616 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9632 1832.497367 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9633 1832.497387 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=37043 Win=17520 Len=0
9634 1832.497955 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9635 1832.499080 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9636 1832.499121 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=39963 Win=17520 Len=0
9637 1832.501823 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9638 1832.506288 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9639 1832.506341 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=42883 Win=17520 Len=0
9640 1832.510019 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9641 1832.514327 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9642 1832.514379 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=45803 Win=17520 Len=0
9643 1832.612211 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9644 1832.613724 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9645 1832.613764 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=48723 Win=17520 Len=0
9646 1832.614146 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9647 1832.614992 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9648 1832.615016 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=51643 Win=17520 Len=0
9649 1832.615336 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9650 1832.616241 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9651 1832.616263 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=54563 Win=17520 Len=0
9652 1832.616565 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9653 1832.630478 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9654 1832.630568 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=57483 Win=17520 Len=0
9655 1832.630887 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9656 1832.631434 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9657 1832.631472 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=60403 Win=17520 Len=0
9658 1832.632155 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9659 1832.635160 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9660 1832.635195 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=63323 Win=17520 Len=0
9661 1832.731659 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9662 1832.736261 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9663 1832.736316 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=66243 Win=80300 Len=0
9664 1832.736902 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9665 1832.737227 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9666 1832.737259 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=69163 Win=80300 Len=0
9667 1832.738315 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9668 1832.738692 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9669 1832.738717 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=72083 Win=80300 Len=0
9670 1832.747247 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9671 1832.751236 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9672 1832.751289 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=75003 Win=80300 Len=0
9673 1832.751602 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9674 1832.752467 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9675 1832.752503 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=77923 Win=80300 Len=0
9676 1832.752794 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9677 1832.755754 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9678 1832.755813 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=80843 Win=84680 Len=0
9679 1832.863406 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9680 1832.863763 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9681 1832.863797 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=83763 Win=81760 Len=0
9682 1832.864108 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9683 1832.864452 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9684 1832.864480 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=86683 Win=78840 Len=0
9685 1832.865043 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9686 1832.865351 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9687 1832.865376 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=89603 Win=75920 Len=0
9688 1832.866438 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9689 1832.867237 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9690 1832.867270 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=92523 Win=73000 Len=0
9691 1832.867580 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9692 1832.870415 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9693 1832.870452 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=95443 Win=70080 Len=0
9694 1832.879004 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9695 1832.879668 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9696 1832.879720 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=98363 Win=67160 Len=0
9697 1832.882250 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9698 1832.891948 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9699 1832.892015 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=101283 Win=64240 Len=0
9700 1832.892064 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9701 1832.894446 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9702 1832.894491 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=104203 Win=61320 Len=0
9703 1832.898480 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9704 1832.902672 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9705 1832.902727 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=107123 Win=58400 Len=0
9706 1832.906739 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9707 1832.981761 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9708 1832.981826 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=110043 Win=55480 Len=0
9709 1832.982174 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9710 1832.982605 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9711 1832.982632 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=112963 Win=52560 Len=0
9712 1832.983437 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9713 1832.984445 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9714 1832.984471 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=115883 Win=49640 Len=0
9715 1832.984782 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9716 1832.985665 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9717 1832.985688 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=118803 Win=46720 Len=0
9718 1832.990243 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9719 1832.992996 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9720 1832.993074 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=121723 Win=43800 Len=0
9721 1832.997430 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9722 1833.000734 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9723 1833.000818 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=124643 Win=40880 Len=0
9724 1833.004981 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9725 1833.008738 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9726 1833.008831 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=127563 Win=37960 Len=0
9727 1833.012701 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9728 1833.016766 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9729 1833.016842 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=130483 Win=35040 Len=0
9730 1833.036403 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9731 1833.036532 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9732 1833.036580 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=133403 Win=32120 Len=0
9733 1833.036637 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9734 1833.036684 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9735 1833.036717 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=136323 Win=29200 Len=0
9736 1833.037244 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9737 1833.041241 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9738 1833.041338 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=139243 Win=26280 Len=0
9739 1833.045264 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9740 1833.049250 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9741 1833.049328 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=142163 Win=23360 Len=0
9742 1833.053237 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9743 1833.057335 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9744 1833.057394 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=145083 Win=20440 Len=0
9745 1833.061983 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9746 1833.065726 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9747 1833.065759 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=148003 Win=17520 Len=0
9748 1833.069727 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9749 1833.073453 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9750 1833.073493 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=150923 Win=14600 Len=0
9751 1833.077667 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9752 1833.086660 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9753 1833.086721 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=153843 Win=11680 Len=0
9754 1833.098982 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9755 1833.099044 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9756 1833.099073 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=156763 Win=8760 Len=0
9757 1833.099653 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9758 1833.100823 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9759 1833.100848 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=159683 Win=5840 Len=0
9760 1833.118864 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9761 1833.118925 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9762 1833.118960 192.168.1.72 208.80.152.201 TCP 54 54605 > http [ACK] Seq=167 Ack=162603 Win=2920 Len=0
9763 1833.118998 208.80.152.201 192.168.1.72 TCP 1514 [TCP segment of a reassembled PDU]
9764 1833.119021 208.80.152.201 192.168.1.72 TCP 1514 [TCP Window Full] [TCP segment of a reassembled PDU]
9765 1833.119039 192.168.1.72 208.80.152.201 TCP 54 [TCP ZeroWindow] 54605 > http [ACK] Seq=167 Ack=165523 Win=0 Len=0
9766 1833.700991 208.80.152.201 192.168.1.72 TCP 54 [TCP Keep-Alive] http > 54605 [ACK] Seq=165522 Ack=167 Win=7168 Len=0
9767 1833.701068 192.168.1.72 208.80.152.201 TCP 54 [TCP ZeroWindow] 54605 > http [ACK] Seq=167 Ack=165523 Win=0 Len=0
9770 1834.565157 208.80.152.201 192.168.1.72 TCP 54 [TCP Keep-Alive] http > 54605 [ACK] Seq=165522 Ack=167 Win=7168 Len=0
9771 1834.565236 192.168.1.72 208.80.152.201 TCP 54 [TCP ZeroWindow] 54605 > http [ACK] Seq=167 Ack=165523 Win=0 Len=0
9773 1836.261331 208.80.152.201 192.168.1.72 TCP 54 [TCP Keep-Alive] http > 54605 [ACK] Seq=165522 Ack=167 Win=7168 Len=0
9774 1836.261407 192.168.1.72 208.80.152.201 TCP 54 [TCP ZeroWindow] 54605 > http [ACK] Seq=167 Ack=165523 Win=0 Len=0
9781 1839.435557 208.80.152.201 192.168.1.72 TCP 54 [TCP Keep-Alive] http > 54605 [ACK] Seq=165522 Ack=167 Win=7168 Len=0
9782 1839.435636 192.168.1.72 208.80.152.201 TCP 54 [TCP ZeroWindow] 54605 > http [ACK] Seq=167 Ack=165523 Win=0 Len=0
9802 1845.579709 208.80.152.201 192.168.1.72 TCP 54 [TCP Keep-Alive] http > 54605 [ACK] Seq=165522 Ack=167 Win=7168 Len=0
9803 1845.579789 192.168.1.72 208.80.152.201 TCP 54 [TCP ZeroWindow] 54605 > http [ACK] Seq=167 Ack=165523 Win=0 Len=0
9824 1857.561202 208.80.152.201 192.168.1.72 TCP 54 [TCP Keep-Alive] http > 54605 [ACK] Seq=165522 Ack=167 Win=7168 Len=0
9825 1857.561281 192.168.1.72 208.80.152.201 TCP 54 [TCP ZeroWindow] 54605 > http [ACK] Seq=167 Ack=165523 Win=0 Len=0

So, at some point in time the TCP client (Java VM or whatever is reading the packets off the TCP stack) is not consuming the packets in the TCP RX window (although it may be reading the packets). The window gets full, and the transmission halts.
939718
I just got the same problem with an applet that loads some big JAR's (about 3MB each). It used to work okay last december but now with the upgrade to Java 7 it keeps sending zero window at random files (depending if it was able to load part of some file).

I had to switch my browser (FireFox running in 32 bits in a Win 7 64 Bits laptop) to use a previous version ( "1.6.0_15" ) and it worked again. I think this is a bug indeed with that version.
941950
I have the same issue after upgrading to jdk 1.7.0_04
My workstation is running 64bit windows 7.

I didn't have time to run the code from this thread or from http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7168409 but:
- my eclipse is unable to get updates from the update sites any more
- my ant scripts are unable to download files that are bigger than few MB: the download hangs after few KB or few hundreds of KB (it looks like it manages to get smaller files without problem)

When I switch back to 1.6.0_32 (by changing an environment variable) without changing anything else on my workstation, everything works fine again so it is definitely not linked to any local firewall setting (windows firewall disabled) or routing/external firewall (the URL I am trying to get the files from with ant are in the local network, same network switch).
gimbal2
When it is related to an upgrade from Java 6 to Java 7, in other words not an update but a completely new release of Java, it will very likely be related to a switch between IPv4 and IPv6 stacks - Java 7 prefers IPv6 and that causes some havoc with network equipment. You can force Java to prefer IPv4 through a command line property:

-Djava.net.preferIPv4Stack=true

You could try that out by adding the parameter to the eclipse.ini file and see if that resolves your updating problems.
941950
great, forcing use of IPv4 has resolved the problem!
thanks a lot
1 - 14
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 4 2012
Added on Nov 12 2011
14 comments
2,785 views