p:feedReader noclassdeffound exception

360 Views Asked by At

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?

2

There are 2 best solutions below

2
Kukeltje On BEST ANSWER

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!

2
Gishas On

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!