I wrote a java program which is a kind of load generation tool. When the
client arrival rate is lager, I got the following exception:
java.lang.NullPointerException
at
sun.net.www.http.ChunkedInputStream.readChunkSize(ChunkedInputStream.java:162)
at
sun.net.www.http.ChunkedInputStream.prefill(ChunkedInputStream.java:187)
at
sun.net.www.http.ChunkedInputStream.<init>(ChunkedInputStream.java:94)
at
sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:738)
at
sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:602)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:485)
at OpenConnection.open(OpenConnection.java:74)
at RequestThread.run(RequestThread.java:144)
************************************************************************
OpenConnection and RequestThread are my two classes.
OpenConnection.java:74 is as following:
BufferedReader in = new BufferedReader(new InputStreamReader(
currentState.openConnection().getInputStream()));
// currentState is an instance of class URL
Any suggestions are welcome!
Ping
Not knowing anything more, this looks like a threading problem. It also
looks like the problem is buried deep inside the Sun HTTP classes. My
suggestion would be to try this on other JVM versions, look on Bug Parade
for others having the same problem, and/or to write a simple (as simple as
possible) program to demonstrate the bug, and then go submit the bug at Bug
Parade.
In the process of performing that last step, you may find something else
that is causing the problem.
Chris Smith