views:

471

answers:

2

I am trying to write a simple Google App Engine website that reads an external RSS feed. I am using ROME with JDOM, however I am getting the impression that ROME is not compatible with Google App Engine and how you may fetch data.

ROME uses the build method of the SyndFeedInput class, but I cannot find any way to how to connect this with Google App Engine and URL Fetch.

My sample code is:

URL url = new URL(rss_url);
Reader r = new InputStreamReader(url.openStream());
SyndFeed feed = new SyndFeedInput().build(r);

But on my third row I get a

java.lang.IllegalStateException: JDOM could not create a SAX parser

It works if I run the code in an own stand alone application, but when I trigger the code via Google App Engine locally, I get the exception.

What I am doing wrong and what alternatives can I try to read an external RSS?

+1  A: 

Looks like ROME isn't supported on GAE:

http://old.nabble.com/ROME-and-AppEngine-td23290454.html

http://code.google.com/p/googleappengine/issues/detail?id=1367

It seems that the workaround is to include a copy of the Xerces JAR in your application, so that JDOM doesn't try to load it from GAE itself.

skaffman
A: 

There is a work around for this issue with JDOM, which then solves the problem for ROME

Place xercesImpl-x.x.x.jar in war/WEB-INF/lib

See http://code.google.com/p/googleappengine/issues/detail?id=1367 Many people copy more than xercesImpl or libraries that contain xerces (e.g. some distributions of xalan), however xercesImpl is all you need.

It is still a work around as it appears JDOM isn't using JAXP correctly to load GAE's SAX parser.

Worked for me with: GAE 1.3.7 rome 1.0 jdom 1.1.1 xercesImpl-2.6.1.jar

Oli Bye