Hi i am Trying to read XLSX file using POI API but an error has been occurred.. 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) I don't know why it happens. I have in my classpath in order this jar files: xmlbeans-2.3.0.jar commons-codec-1.5.jar commons-logging-1.1.jar dom4j-1.6.1.jar junit-3.8.1.jar log4j-1.2.13.jar poi-3.9-20121203.jar poi-ooxml-schemas-3.9-20121203.jar poi-examples-3.9-20121203.jar poi-excelant-3.9-20121203.jar poi-ooxml-3.9-20121203.jar poi-scratchpad-3.9-20121203.jar stax-api-1.0.1.jar With Windows XP 32bit i can read ".xls" and ".xlsx". The same under Windows 7 64bit with Office 2007 it works but not with Windows 7 64bit with Office 2010. The Exception is on the secound line InputStream inp = new FileInputStream("***.xlsx"); Workbook workbook = WorkbookFactory.create(inp);
*** Bug 54812 has been marked as a duplicate of this bug. ***
The error indicates you have an older version of xmlbeans on your classpath that is being used. Remove that old one and it'll work correctly.
i work with xmlbeans-2.3.0.jar it is the latest from the website
You have multiple copies of xmlbeans on your classpath, remove the older one(s)
Created attachment 30162 [details] Build Path Build Path of the Project (Name of Project is hidden)
(In reply to comment #5) > Created attachment 30162 [details] Build Path Build Path of the Project > (Name of Project is hidden) I dont see a secound xmlBean
The POI FAQ has advice on locating duplicate jars: http://poi.apache.org/faq.html This is not a support forum for getting help with your build path or deployment issues
I have look on your site i have only the one jar. I have no duplicate i think it is a Bug because the project work with Windows 7 64bit and Excel 2007 but with Windows 7 64bit and Excel 2010 the Project broken up and i get the Exception NoSuchMethodError.
You have an older version of xmlbeans on your classpath, which is why you're getting the error. You may not think you do, but you do If you don't know how to check what jars you have on your classpath, as opposed to which ones you think you have, you'll need to go and seek support from a forum appropriate to your stack No further help will be provided here, as you've repeatedly ignored the help you have been offered
I have check my class path i have only the lates xmlBean in the class path make a look to the attachement. Why it works with Windows 7 64bit and Excel 2007 but not with Excel 2010?