NullPointerException inside HttpUrlConnection::plainConnect

J

jason.keirstead

Hello. I am getting an exception when I try to execute the following
simple code:

URL rssURL = new URL("http://rss.slashdot.org/Slashdot/slashdot");
rssURL.openStream();

Here is the exception. It is very baffling and annoying since I can not
figure out what is "null" since I don't have the source to the JDK (I
did download the SCSL source, but it's from version 1.5.0.0 and the
line numbers in this class do not line up with 1.5.0.9)

Does anyone have any idea what is wrong?

java.lang.NullPointerException
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:785)
at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:673)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:917)
at java.net.URL.openStream(URL.java:1007)
 
M

Manish Pandit

Hi,

I had the same kind of problem once (with Google's Blogger API) and was
baffled for weeks. Turned out that I had an antivirus/firewall on my
box that prevented the JVM from making outgoing connections. Can you
check if this could be the case with you? I had PC-Cillin
firewall/antivirus - I removed java/jre from the list of blocked
programs and it worked like a charm.

-cheers,
Manish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top