0

I am trying to create a simple RSS reader in JSF web project (Eclipse).

Here is Primefaces snippet for RSS:

    <h:panelGrid>
    <br/>
<h:outputText styleClass="font1" value="Travel feeds:"/>
<hr/>
<p:feedReader value="http://www.faroo.com/api?q=travel&amp;l=en&amp;src=news&amp;f=rss" var="feed">
    <a href="#{feed.link}" class="link">#{feed.title}</a>
    <h:outputText value="#{feed.description.value}" escape="false"/>
    <p:separator />
</p:feedReader>
</h:panelGrid>

I included this to the very same page:

xmlns:p="http://primefaces.org/ui"

and libraries I included using "Configure build path" are following:

primefaces-6.2-sources.jar, primefaces-6.2.jar, rome-1.0.jar

Also tried to copy them directly to WEB-INF/libfolder, that didn't help either.

So what the actual problem is?

I got exceptions like this:

    exception 
javax.servlet.ServletException: com/rometools/rome/io/XmlReader
    javax.faces.webapp.FacesServlet.service(Unknown Source)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)



root cause 
java.lang.NoClassDefFoundError: com/rometools/rome/io/XmlReader
    org.primefaces.component.feedreader.FeedReaderRenderer.encodeEnd(FeedReaderRenderer.java:35)
    javax.faces.component.UIComponentBase.encodeEnd(Unknown Source)
    com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(Unknown Source)
    com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(Unknown Source)
    com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(Unknown Source)
    javax.faces.component.UIComponentBase.encodeChildren(Unknown Source)
    javax.faces.component.UIComponent.encodeAll(Unknown Source)
    javax.faces.component.UIComponent.encodeAll(Unknown Source)
    javax.faces.component.UIComponent.encodeAll(Unknown Source)
    com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(Unknown Source)
    com.sun.faces.application.view.MultiViewHandler.renderView(Unknown Source)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(Unknown Source)
    com.sun.faces.lifecycle.Phase.doPhase(Unknown Source)
    com.sun.faces.lifecycle.LifecycleImpl.render(Unknown Source)
    javax.faces.webapp.FacesServlet.service(Unknown Source)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)



root cause 
java.lang.ClassNotFoundException: com.rometools.rome.io.XmlReader
    org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1856)
    org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1705)
    org.primefaces.component.feedreader.FeedReaderRenderer.encodeEnd(FeedReaderRenderer.java:35)
    javax.faces.component.UIComponentBase.encodeEnd(Unknown Source)
    com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(Unknown Source)
    com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(Unknown Source)
    com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(Unknown Source)
    javax.faces.component.UIComponentBase.encodeChildren(Unknown Source)
    javax.faces.component.UIComponent.encodeAll(Unknown Source)
    javax.faces.component.UIComponent.encodeAll(Unknown Source)
    javax.faces.component.UIComponent.encodeAll(Unknown Source)
    com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(Unknown Source)
    com.sun.faces.application.view.MultiViewHandler.renderView(Unknown Source)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(Unknown Source)
    com.sun.faces.lifecycle.Phase.doPhase(Unknown Source)
    com.sun.faces.lifecycle.LifecycleImpl.render(Unknown Source)
    javax.faces.webapp.FacesServlet.service(Unknown Source)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)



note The full stack trace of the root cause is available in the Apache Tomcat/7.0.67 logs.

Really can't find a solution to this. What have I missed here? I didn't include needed .jar files or I included them the wrong way?

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Gishas
  • 380
  • 6
  • 21

2 Answers2

1

The solution to this PrimeFaces 6.2 issue mentioned in the PrimeFaces issuelist

In the PrimeFaces documentation:

  • rome 1.5.0 Optional FeedReader

In the migration info:

You need a newer version of Rome, 1.5.0 instead of 1.0!

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
  • it is good practice in SO to '.accept' good answers. And if they were really helpful also upvote it – Kukeltje May 17 '18 at 06:07
  • Yes, I usually do that, but was really in a rush this morning :) It's done now and thank you for your participation and hard work to get this issue solved! @Kukeltje – Gishas May 17 '18 at 09:50
-1

Downgrading Primefaces to 5.3 version (from 6.*) and including jdom-1.1.1.jar library seem to have solved the problem. Primefaces RSS reader is working now. Can't really say if it's Primefaces version problem, or jdom dependency, or both. Just hope this would at least give a clue to someone who might come up with the same issue.

Thanks for help, guys!

Gishas
  • 380
  • 6
  • 21
  • so you did not look in the folder logs as the 'screen error' mentioned not did you try using the same config with jdom with PF 6.2? – Kukeltje May 10 '18 at 20:04
  • Ok, so I reverted it back to PF 6.2 and it won't work. Definitely some PrimeFaces version issue! – Gishas May 12 '18 at 13:58