Custom RSS feeds
I need to write a custom RSS feed. I am trying to generate using the rome api. But when ever i import it I am getting exception.
Has anyone tried it and is able to achieve the same.
Thanks in advance.
I need to write a custom RSS feed. I am trying to generate using the rome api. But when ever i import it I am getting exception.
Has anyone tried it and is able to achieve the same.
Thanks in advance.
Ok. I've tried to replicate this and got the same problems.
It turned out the even though i had this in the POM:
<dependency> <groupId>rome</groupId> <artifactId>rome</artifactId> <version> 1.0</version> </dependency>
I needed to export the classes needed aswell with this in the bundle plugin config:
<Export-Package> com.sun.syndication.* </Export-Package>
Also there is a dependency on org.jdom which leads to the following changes that you will have to make.
1) Add:
<dependency>
<dependency> <groupId>jdom</groupId> <artifactId>jdom</artifactId> <version>1.0</version> </dependency>
2) Change to:
<Export-Package> com.sun.syndication.*, org.jdom.* </Export-Package> <Import-Package>
That made it work for me at least. Something like this can be used:
URL url = new URL(MY_URL); HttpURLConnection httpcon = (HttpURLConnection)url.openConnection(); SyndFeedInput input = new SyndFeedInput(); SyndFeed feed = input.build(new XmlReader(httpcon));
Good luck :)
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.