Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Apache POI Upgrade issue

583867Nov 7 2011 — edited Nov 8 2011
Hi,

I am working for an ADF application and here we have used POI 2.5 JAR file for the excel reading.

Now we are upgrading to poi-3.8-beta3 VERSION to handle both xls and xlsx versions. But we are getting the following error when trying to execute the below code snippet.


POIFSFileSystem fileSystem = new POIFSFileSystem(inputStream);
HSSFWorkbook workBook = new HSSFWorkbook(fileSystem);

Error Message:

org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)


Is there way to fix this issue without making any code change so that it should support both the excel versions. Please suggest.

Thanks,
Manasa
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 6 2011
Added on Nov 7 2011
2 comments
592 views