Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WLS 6.1 on NT4: Strange HTTP NPE

1 view
Skip to first unread message

Kevin Sit

unread,
Feb 27, 2003, 3:56:26 PM2/27/03
to

Hello,

WebLogic version: 6.1 SP2
OS version: NT4 SP6
JDK: 1.3.1

We are having some problems when we try to establish a connection to our WLS server
with the following code:

URL url = new URL(urlString);
URLConnection con = url.openConnection();
((HttpURLConnection) con).getResponseCode();

An exception is thrown when we try to get the response code from the server:

java.lang.NullPointerException
at sun.net.www.http.ChunkedInputStream.readChunkSize(ChunkedInputStream.java:194)
at sun.net.www.http.ChunkedInputStream.prefill(ChunkedInputStream.java:219)
at sun.net.www.http.ChunkedInputStream.<init>(ChunkedInputStream.java:121)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:774)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:531)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:260)
at <our program code>

The same piece of code works with other app servers, so we assume that this might
be a WLS issue. Have you guys seen this exception before?

Any help would be highly appreciated.

Thank you,
Kevin

Eric Gross

unread,
Feb 28, 2003, 1:21:20 PM2/28/03
to
Any error on the WebLogic side?

Also, can you try SP4?

Eric

"Kevin Sit" <kevi...@hotmail.com> wrote in message
news:3e5e7b7a$1...@newsgroups.bea.com...

Xiang Rao

unread,
Mar 1, 2003, 11:33:36 AM3/1/03
to

Try to access your URL from a web browser to see if it can go through. If not,
the problem is most likely at the servlet/jsp. If yes, try to add con.setRequestProperty("Host","your_wl_host:your_wl_port");
sometime, you also need add "User-Agent" like con.setRequestProperty("User-Agent",
"Mozilla/4.0
(compatible;
MSIE 6.0; Windows NT 5.0)");

You can also use some Sniffer to check the data communicated between browser and
the server, and add the contents in HTTP header part to your code as above.

On the other hand, you need know if the server side (servlet/jsp) expects you
to connect with HTTP POST. If so, you need con.setDoOutput(true); and send your
request data via outputstream.

0 new messages