java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setSaveAggressiveNamespaces()Lorg/apache/xmlbeans/XmlOptions;
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20799326/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setSaveAggressiveNamespaces()Lorg/apache/xmlbeans/XmlOptions;
提问by prashantk87
I am trying to write a program which write the data in Excel. But i keep getting an error which is shown below:
我正在尝试编写一个在 Excel 中写入数据的程序。但我不断收到如下所示的错误:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setSaveAggressiveNamespaces()Lorg/apache/xmlbeans/XmlOptions;
at org.apache.poi.POIXMLDocumentPart.<clinit>(POIXMLDocumentPart.java:56)
at wriExcel.main(wriExcel.java:19)
On finding the solutions, I could only find that I should use XMLBeans 2.0
or higher.
But, I am using xmlbeans 2.3.0
.
Is there any other reason for this error.
在找到解决方案时,我只能发现我应该使用XMLBeans 2.0
或更高。但是,我正在使用xmlbeans 2.3.0
. 是否有任何其他原因导致此错误。
回答by Ashish
This error might be because required needed for the project is not there so you have to download jar and then add that jar to your classpath here is the link
此错误可能是因为项目所需的所需文件不存在,因此您必须下载 jar,然后将该 jar 添加到您的类路径中, 这里是链接
find out which jar you need
找出你需要的罐子
回答by PVR
Use xmlbeans-2.6.0.jar
which resolves my problem...!
使用xmlbeans-2.6.0.jar
它解决了我的问题......!
回答by Kishor Deotale
Use the xmlbeans jar file shipped with PIO libraries, and avoid to download from any other source as there will be jar file conflicts.
使用 PIO 库附带的 xmlbeans jar 文件,避免从任何其他来源下载,因为会出现 jar 文件冲突。
You can find the xmlbeans under "ooxml-lib" shipped with PIO.
您可以在 PIO 附带的“ooxml-lib”下找到 xmlbeans。