java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/RichTextString at org.primefaces.component.export.ExporterFactory.getExporterForType
19,419
javax.servlet.ServletException: org/apache/poi/ss/usermodel/RichTextString
Look further down in the stacktrace. I bet that the root cause is either a NoClassDefFoundError
or ClassNotFoundException
? In that case, this just means that you forgot to install Apache POI.
Download this Apache POI zip file, extract it, put poi-3.8-20120326.jar in /WEB-INF/lib
folder and rebuild/redeploy/restart the webapp.
Author by
Deb
Updated on June 05, 2022Comments
-
Deb almost 2 years
I used the same sample code Primefaces has in its web page:
<h:commandLink value="Excel"> <p:dataExporter type="xls" target="dataTable" fileName="boo" pageOnly="true"/> </h:commandLink>
But does not work. In Internet Explorer browser gives the following message:
Details of the errors of the web page Message: Unexpected call to method or property access.
Nothing ever happens in Mozilla Firefox.
What might be happening?
-
Deb over 11 yearsI downloaded the full package poi. My Excel 2003, that is trying to generate the xlsx and so is giving error? Well from what I read in the poi.apache.org poi3.8 versions should work for both Excel 2003 and for 2007 and 2010.
-
Deb over 11 yearsI added the libraries poi 3.8 and now is giving the following exception: javax.servlet.ServletException: Class Does Not Implement org.apache.poi.hssf.usermodel.HSSFWorkbook the requested interface org.apache.poi.ss.usermodel.Workbook . Any idea of what can be?
-
BalusC over 11 yearsApparently you've also installed JExcelAPI for some reason and imported
Workbook
from the wrong package. Make sure that it's theorg.apache.poi.ss.usermodel.Workbook
one and remove JExcelAPI if you aren't using it at all. -
Deb over 11 yearsI didn't find apiapi to manipulate Excel. Nor have JExcelAPI. I honestly don't know how to solve it.
-
BalusC over 11 yearsOkay. Maybe you have multiple Apache POI libraries of possibly different versions in your webapp's runtime classpath? That could also be a cause. Cleanup the webapp's runtime classpath so that you end up with only one right version of POI.
-
Deb over 11 yearsI got excluding all other versions of poi from my folder. Even not being on the classpath of the project, was giving conflicting.
-
JPS about 10 years@BalusC: I am using primefaces 4.0 and in my WEB-INF/lib folder i have poi-9.0.jar. Still i am getting the "javax.servlet.ServletException: org/apache/poi/ss/usermodel/RichTextString" error. Is there any problem with the version?