[英]“java.lang.NoSuchMethodError” exception in reading xmlbeans
I am trying to read XLSX file.its showing this error 我正在尝试读取XLSX file.its显示此错误
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setSaveAggressiveNamespaces()Lorg/apache/xmlbeans/XmlOptions;
at org.apache.poi.POIXMLDocumentPart.<clinit>(POIXMLDocumentPart.java:46)
at NewClass.main(NewClass.java:33)
Java Result: 1
error is in line: 错误所在:
OPCPackage opc=OPCPackage.open(is);
XSSFWorkbook wb= new XSSFWorkbook(opc);
确保您的类路径上具有正确的XmlBeans版本(2.x)。
XmlOptions setSaveAggresiveNamespaces() : Deprecated. replaced by setSaveAggressiveNamespaces() in 2.0
XmlOptions setSaveAggresiveNamespaces():
Deprecated. replaced by setSaveAggressiveNamespaces() in 2.0
Deprecated. replaced by setSaveAggressiveNamespaces() in 2.0
. Deprecated. replaced by setSaveAggressiveNamespaces() in 2.0
。 You might be using Apache XMLBeans 1.x library. 您可能正在使用Apache XMLBeans 1.x库。 Either use latest release(recommended) or change method call to
setSaveAggresiveNamespaces()
使用最新版本(推荐)或将方法调用更改为
setSaveAggresiveNamespaces()
Check that your version of xmlbeans is correct. 检查您的xmlbeans版本是否正确。 If you are using maven, finds that there is no other unit that contains a different version of xmlbeans.
如果您使用的是maven,则会发现没有其他单元包含不同版本的xmlbeans。 (Use mvn dependency: tree)
(使用mvn依赖项:树)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.