I had tried, but was not able to achieve it. Could you plz share the jar file so that it would be useful for me
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.
Solved! Go to Solution.
Views
Replies
Total Likes
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 :)
Views
Replies
Total Likes
I have never tried that API -- however other APIs like Twitter API work with no issues:
http://scottsdigitalcommunity.blogspot.ca/2013/02/creating-aem-feed-components-that.html
What exception are you getting?
Views
Replies
Total Likes
Whenever i import com.sun.syndication.feed.synd.syndfeed i am getting an exception like the below
Views
Replies
Total Likes
Are you sure that you have imported it with the right case: com.sun.syndication.feed.synd.SyndFeed (looks right in the log though) Maybe just typo in the post? Also note that this is an interface so you cannot instantiate it directly. You also might need to use the fully qualified classname when declaring beans of this type. Can you provide an example how you tried to implement it? /johan
Views
Replies
Total Likes
Yes i have tried it using sling.getService(), but no luck.
Even though if there is no logic in my jsp (say a blank file with global.jsp and import of com.sun.syndication.feed.synd.syndfeed), it still shows me the same error
Views
Replies
Total Likes
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 :)
Views
Replies
Total Likes
I had tried, but was not able to achieve it. Could you plz share the jar file so that it would be useful for me
Thanks in advance
Views
Replies
Total Likes
Ojjis wrote...
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 :)
I had tried, but was not able to achieve it. Could you plz share the jar file so that it would be useful for me
Thanks in advance
Views
Replies
Total Likes
Hi, what is still not working for you ?
I had no jar files from the beginning at all. I let maven handle those dependencies for me.
In my "main pom.xml" i added:
<dependency>
<groupId>rome</groupId>
<artifactId>rome</artifactId>
<version> 1.0</version>
</dependency>
and
<dependency>
<groupId>jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.0</version>
</dependency>
Then i added those two without the version to my "company-core pom.xml" (where eg. all the java classes are).
In the "company-core pom.xml " I also changed this part to export these packages to the rest of the application:
... <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Export-Package> com.sun.syndication.*, org.jdom.* </Export-Package> <Import-Package> *;resolution:=optional </Import-Package> <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency> <Sling-Test-Regexp>.*Test</Sling-Test-Regexp> <Include-Resource>META-INF/company-common.tld=target/classes/META-INF/company-common.tld,OSGI-INF/serviceComponents.xml=target/scr-plugin-generated/OSGI-INF/serviceComponents.xml</Include-Resource> </instructions> </configuration> </plugin> ...</plugins> </build> ....
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies