简体   繁体   English

使用POI API创建XLSX

[英]Creating XLSX using POI API

I am Trying to create XLSX file using POI API but an error has been occurred.. 我正在尝试使用POI API创建XLSX文件,但发生了错误。

java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setSaveAggressiveNamespaces()Lorg/apache/xmlbeans/XmlOptions; java.lang.NoSuchMethodError:org.apache.xmlbeans.XmlOptions.setSaveAggressiveNamespaces()Lorg / apache / xmlbeans / XmlOptions; at org.apache.poi.POIXMLDocumentPart.(POIXMLDocumentPart.java:56) 在org.apache.poi.POIXMLDocumentPart。(POIXMLDocumentPart.java:56)

and i am not able to figure out the reason of this error please help me out... 而且我无法找出此错误的原因,请帮帮我...

Here is a similar question. 是一个类似的问题。 The problem seems to be either having both xbean.jar and xmlbeans.jar in your classpath or dom4j.jar missing from the classpath. 问题似乎是您的类路径中同时存在xbean.jar和xmlbeans.jar或类路径中缺少dom4j.jar。

It looks like you have an older version of XmlBeans on your classpath. 看起来您的类路径上有XmlBeans的较旧版本。 Apache POI requires XMLBeans 2.3 or newer (newer is fine, older isn't!). Apache POI需要XMLBeans 2.3或更高版本(较新的版本就可以,较旧的版本不是!)。 See the components page for details of the dependencies, which you also get in the binary download. 有关依赖项的详细信息,请参见组件页面 ,您也可以从二进制下载中获得。 Just remove the older version, make sure a new enough version of xmlbeans is present, and you should be fine! 只需删除较旧的版本,确保存在新的足够的xmlbeans版本,就可以了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM