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
Also, can you try SP4?
Eric
"Kevin Sit" <kevi...@hotmail.com> wrote in message
news:3e5e7b7a$1...@newsgroups.bea.com...
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.