We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Couldn't create a reader
Page Index Toggle Pages: 1
Couldn't create a reader (Read 470 times)
Couldn't create a reader
Jun 28th, 2008, 9:53am
 

I have an app which reads an xml file and produces some output.
It all works within the processing IDE, with the xml as a local file or a URL.

When I export thew app and try via a local browser, with a local xml file, it works.  Great.

If I try with a local browser, but the source xml file is via http, I get the error :

Couldn't create a reader for http://10.0.0.11/nagios/xml/status2xml2.cgi
Error while running applet.
java.lang.NullPointerException
at processing.xml.XMLElement.readChar(XMLElement.java:2517)
at processing.xml.XMLElement.scanWhitespace(XMLElement.java:2199)
at processing.xml.XMLElement.parseFromReader(XMLElement.java:1640)
at processing.xml.XMLElement.parseFromReader(XMLElement.java:1598)
at processing.xml.XMLElement.<init>(XMLElement.java:485)
at graph5.createNodesFromXML(graph5.java:579)
at graph5.setup(graph5.java:34)
at processing.core.PApplet.handleDisplay(PApplet.java:1390)
at processing.core.PGraphics.requestDisplay(PGraphics.java:690)
at processing.core.PApplet.run(PApplet.java:1562)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at processing.xml.XMLElement.readChar(XMLElement.java:2517)
at processing.xml.XMLElement.scanWhitespace(XMLElement.java:2199)
at processing.xml.XMLElement.parseFromReader(XMLElement.java:1640)
at processing.xml.XMLElement.parseFromReader(XMLElement.java:1598)
at processing.xml.XMLElement.<init>(XMLElement.java:485)
at graph5.createNodesFromXML(graph5.java:579)
at graph5.setup(graph5.java:34)
at processing.core.PApplet.handleDisplay(PApplet.java:1390)
at processing.core.PGraphics.requestDisplay(PGraphics.java:690)
at processing.core.PApplet.run(PApplet.java:1562)
at java.lang.Thread.run(Unknown Source)


I don't understand why it work with a local data file, but not a URL.
Is there some generic reason an exported app would not access files via http ?
Re: Couldn't create a reader
Reply #1 - Jun 28th, 2008, 10:18pm
 
Quote:
Applets may not connect to servers other than the one from which they came.

from Reference > Troubleshooting > Export and Browser Troubles
http://processing.org/reference/troubleshooting/index.html#applet

Signing your applet may help, as explained here:
http://processing.org/reference/environment/export.html#security
Page Index Toggle Pages: 1