0

I am trying to read XLSX file.its showing this error

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);
1
  • which of those two lines is line #33? Commented Sep 28, 2012 at 22:44

3 Answers 3

1

Make sure you have correct version (2.x) of XmlBeans on you classpath.

Sign up to request clarification or add additional context in comments.

1 Comment

xmlbeans 2.3 is the minimum version to work with Apache POI, anything newer than that ought to work fine too
0

See javadoc :

XmlOptions setSaveAggresiveNamespaces() : Deprecated. replaced by setSaveAggressiveNamespaces() in 2.0. You might be using Apache XMLBeans 1.x library. Either use latest release(recommended) or change method call to setSaveAggresiveNamespaces()

Comments

0

Check that your version of xmlbeans is correct. If you are using maven, finds that there is no other unit that contains a different version of xmlbeans. (Use mvn dependency: tree)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.