Bug 54811 - can't read xlsx File - Error NoSuchMethodError
Summary: can't read xlsx File - Error NoSuchMethodError
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.9-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
: 54812 (view as bug list)
Depends on:
Reported: 2013-04-08 09:33 UTC by stefan.kostrau
Modified: 2013-05-25 22:30 UTC (History)
0 users

Build Path (22.23 KB, image/png)
2013-04-08 11:05 UTC, stefan.kostrau

Note You need to log in before you can comment on or make changes to this bug.
Description stefan.kostrau 2013-04-08 09:33:58 UTC
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:

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);
Comment 1 stefan.kostrau 2013-04-08 09:45:38 UTC
*** Bug 54812 has been marked as a duplicate of this bug. ***
Comment 2 Nick Burch 2013-04-08 09:48:47 UTC
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.
Comment 3 stefan.kostrau 2013-04-08 09:52:30 UTC
i work with xmlbeans-2.3.0.jar it is the latest from the website
Comment 4 Nick Burch 2013-04-08 10:09:05 UTC
You have multiple copies of xmlbeans on your classpath, remove the older one(s)
Comment 5 stefan.kostrau 2013-04-08 11:05:44 UTC
Created attachment 30162 [details]
Build Path

Build Path of the Project (Name of Project is hidden)
Comment 6 stefan.kostrau 2013-04-08 11:09:58 UTC
(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
Comment 7 Nick Burch 2013-04-08 11:12:55 UTC
The POI FAQ has advice on locating duplicate jars:

This is not a support forum for getting help with your build path or deployment issues
Comment 8 stefan.kostrau 2013-04-08 11:27:56 UTC
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.
Comment 9 Nick Burch 2013-04-08 11:31:32 UTC
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
Comment 10 stefan.kostrau 2013-04-08 11:42:54 UTC
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?