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 rulebooksToExcel.GenerateExcel.generateExcel(GenerateExcel.java:34)
at rulebooksToExcel.ParseNortDocFiles.main(ParseNortDocFiles.java:165)
I am getting the error at :
workbook = new XSSFWorkbook(in);
I read other similar questions but they all suggest XMLBeans Version 2.0+. But I am using 2.6, and I can't find any other explanation for what might be causing this.
You may have an older version of xmlbeans on your classpath, in an application server environment (As m4gic said).
I run that code snippet and saw that XmlOptions was being loaded from Weblogic modules;
I solved this problem by forcing Weblogic to use application packages for xmlbeans. (For war type deployments it is in the weblogic.xml under WEB-INF folder)