java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setSaveAggressiveNamespaces()Lorg/apache/xmlbeans/XmlOptions;
Asked Answered
K

3

6

I am trying to write a program which write the data in Excel. But i keep getting an error which is shown below:

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.

Kalie answered 27/12, 2013 at 10:50 Comment(5)
This is a duplicate #11213152 Check you classpath. There might be a conflicting older XMLBeans version somewhere, either bundled with some other library, or provided by whatever framework/appserver you are using.Tautologism
@Kalie if your problem is solved by my answer then you can select my answerMarcelo
thanks @KarlP, but there are no other conflicting XMLBeans version.Kalie
I can only point to the previous question. Download XMLBeans and place it early in the classpath.Tautologism
Placing XMLBeans earlier in classpath worked. thanks KarlPKalie
P
10

Use xmlbeans-2.6.0.jar which resolves my problem...!

Pauiie answered 9/6, 2016 at 8:9 Comment(1)
Previously I was using xmlbeans-2.3.0.jar. Now after changing to this version. It got fixed.Scaler
M
0

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

find out which jar you need

Marcelo answered 27/12, 2013 at 10:58 Comment(1)
try to download latest version of the jarMarcelo
T
0

Use the xmlbeans jar file shipped with PIO libraries, and avoid to download from any other source as there will be jar file conflicts.

You can find the xmlbeans under "ooxml-lib" shipped with PIO.

Telegraphy answered 1/11, 2018 at 14:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.