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)
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