Hey y’all, I’m trying to fetch an xml document from a URL for a daily quote, but despite the link working outside of Processing (it resolves in my browser and in an online xml reader), I’m getting lots of strange errors when I try in Processing.
XML x;
void setup() {
size(400, 400);
background(255);
x = loadXML("https://www.chabad.org/tools/rss/dailyquote_rss.xml");
}
void draw() {
saveXML(x, "save.xml");
noLoop();
}
Here are the errors I get:
java.io.IOException: Server returned HTTP response code: 403 for URL: Chabad.org2 -- Daily Quote
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1944)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1939)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1938)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1508)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
at processing.core.PApplet.createInputRaw(PApplet.java:7152)
at processing.core.PApplet.createInput(PApplet.java:7098)
at processing.core.PApplet.createReader(PApplet.java:6904)
at processing.core.PApplet.loadXML(PApplet.java:5995)
at processing.core.PApplet.loadXML(PApplet.java:5985)
at XML_test.setup(XML_test.java:28)
at processing.core.PApplet.handleDraw(PApplet.java:2425)
at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: Chabad.org2 -- Daily Quote
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:347)
at processing.core.PApplet.createInputRaw(PApplet.java:7145)
… 8 more
The file “Chabad.org2 -- Daily Quote” is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.
NullPointerException
I’ve tried to resolve some sample xml URLs, and some of them worked, but others do not. Any ideas why or how I can get this working?
Much appreciated <3