p:dataExporter抛出java.lang.NoClassDefFoundError:com / lowagie / text / phrase [英] p:dataExporter throws java.lang.NoClassDefFoundError: com/lowagie/text/phrase
问题描述
我尝试使用primefaces 3.2的数据导出器控件。以下是代码:
I tried to use the data exporter control of primefaces 3.2. Following is the code:
<p:commandLink value="export" ajax="false">
<p:dataExporter type="xls" target="dtable" fileName="myfile" />
</p:commandLink>
<p:datatable id="dtable" ........../>
当我点击导出链接时,我收到以下错误:
When I click on export link, I get the following error:
java.lang.NoClassDefFoundError: com/lowagie/text/phrase
我下载了itext jar 5.2.1并将其包含在我的应用程序中,但我仍然得到同样的错误。
如何解决?
I downloaded itext jar 5.2.1 and included it in my application, still I get the same error. How do I solve it?
推荐答案
尝试iText 2.1.7而不是5.2.1。
http://olex.openlogic.com/packages/itext/2.1.7
Try iText 2.1.7 not 5.2.1. http://olex.openlogic.com/packages/itext/2.1.7
我认为存在许可证冲突。所以primefaces使用2.1.7
I think there are licence conflicts. So primefaces uses 2.1.7
对于Excel Export,您需要Apache POI。
尝试3.7: http://archive.apache.org/dist/poi / release / bin /
For Excel Export you need Apache POI. Try 3.7: http://archive.apache.org/dist/poi/release/bin/
修改
(您需要只有 poi-3.7 * .jar
和 poi-ooxml-3.7 * .jar
)
这篇关于p:dataExporter抛出java.lang.NoClassDefFoundError:com / lowagie / text / phrase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!