You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Andre-John Mas <aj...@sympatico.ca> on 2010/04/15 15:14:59 UTC

The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?

Hi,

I am trying to read an Excel 2007 file and I running into the following issue:

java.lang.IllegalArgumentException: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?
      at org.apache.poi.hssf.usermodel.HSSFWorkbook.getWorkbookDirEntryName(HSSFWorkbook.java:236)
      at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:258)
      at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:201)
      at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:317)
      at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:298)
      at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:60)
      
Other Excel 2007 files open without any issues, and while this particular Excel file doesn't open
with POI, it does in Excel 2007. Are there any POIdevelopers who would be able to look at this file,
to see what the cause may be? I have not attached the file.

André-John
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?

Posted by Andre-John Mas <aj...@sympatico.ca>.
On 15-Apr-2010, at 09:26, Nick Burch wrote:

> On Thu, 15 Apr 2010, Andre-John Mas wrote:
>> I am trying to read an Excel 2007 file and I running into the following issue:
>> 
>> java.lang.IllegalArgumentException: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?
> 
> Your file isn't in the expected structure. You could try running org.apache.poi.poifs.dev.POIFS.POIFSLister against it to see what it contains instead

I'll give that a go. Does Excel 2007 have variations on the file format?

André-John
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?

Posted by Andre-John Mas <aj...@sympatico.ca>.
On 16-Apr-2010, at 10:21, David Fisher wrote:

>>>> What I don't seem to understand is why the Excel 2003 parser (HSSF) is being used when I call WorkbookFactory.create() on this file, instead of the Excel 2007 parser (XSSF). The file ends in '.xlsx'.
>>> 
>>> Since you got the output that you did from POIFSLister, it's clear that your document in an OLE2 document, not an ooxml one. That's also why you get the exception you do when you try to load it with XSSF.
>> 
>> The odd thing is that if I try resaving it as a new Office 2007 file or a new Office 2003 the file, with Excel 2007, it still can't be read by POI, even if it they can be reopend with Excel. Its almost as if it is a data issue.
>> 
>> Additional investigation: I tried opening the file with "Numbers" on the Mac and it couldn't open it. Trying to open it with Office 2008, on MacOS X, and I get the message "The workbook contains content that is not supported  by Excel  2008 for Mac: OLE DB query tables". Trying to unzip the, or look at it in a hex editor indicates this is not zipped content.
>> 
>> I am really going to have to investigate how this file was created in the first place, and why Excel is saving an apparent Office 2007 is saving the document as OLE. Is it possible that Excel will use the OLE format if there is a feature not supported by the OOXML format?
>> 
>> If any of the developers want to look at the file, I will happily supply it.
> 
> It looks like a strange case. If you find out how exactly it was created we can see if and how POI might need to adapt.
> 
> I wonder if it is a "xlsb" file that says it is xlsx? But that's just a guess.

Its looks like it, though it is being specified as xlsx in Excel when saved. I am wondering whether OLE DB query tables, or some other data type in the document, can't be represented by OOXML, causing Excel to switch to xlsb? Looks like a point of investigation.

André
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?

Posted by David Fisher <df...@jmlafferty.com>.
>>> What I don't seem to understand is why the Excel 2003 parser (HSSF) is being used when I call WorkbookFactory.create() on this file, instead of the Excel 2007 parser (XSSF). The file ends in '.xlsx'.
>> 
>> Since you got the output that you did from POIFSLister, it's clear that your document in an OLE2 document, not an ooxml one. That's also why you get the exception you do when you try to load it with XSSF.
> 
> The odd thing is that if I try resaving it as a new Office 2007 file or a new Office 2003 the file, with Excel 2007, it still can't be read by POI, even if it they can be reopend with Excel. Its almost as if it is a data issue.
> 
> Additional investigation: I tried opening the file with "Numbers" on the Mac and it couldn't open it. Trying to open it with Office 2008, on MacOS X, and I get the message "The workbook contains content that is not supported  by Excel  2008 for Mac: OLE DB query tables". Trying to unzip the, or look at it in a hex editor indicates this is not zipped content.
> 
> I am really going to have to investigate how this file was created in the first place, and why Excel is saving an apparent Office 2007 is saving the document as OLE. Is it possible that Excel will use the OLE format if there is a feature not supported by the OOXML format?
> 
> If any of the developers want to look at the file, I will happily supply it.

It looks like a strange case. If you find out how exactly it was created we can see if and how POI might need to adapt.

I wonder if it is a "xlsb" file that says it is xlsx? But that's just a guess.

Regards,
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?

Posted by Andre-John Mas <aj...@sympatico.ca>.
On 16-Apr-2010, at 04:41, Nick Burch wrote:

> On Thu, 15 Apr 2010, Andre-John Mas wrote:
>> What I don't seem to understand is why the Excel 2003 parser (HSSF) is being used when I call WorkbookFactory.create() on this file, instead of the Excel 2007 parser (XSSF). The file ends in '.xlsx'.
> 
> Since you got the output that you did from POIFSLister, it's clear that your document in an OLE2 document, not an ooxml one. That's also why you get the exception you do when you try to load it with XSSF.

The odd thing is that if I try resaving it as a new Office 2007 file or a new Office 2003 the file, with Excel 2007, it still can't be read by POI, even if it they can be reopend with Excel. Its almost as if it is a data issue.

Additional investigation: I tried opening the file with "Numbers" on the Mac and it couldn't open it. Trying to open it with Office 2008, on MacOS X, and I get the message "The workbook contains content that is not supported  by Excel  2008 for Mac: OLE DB query tables". Trying to unzip the, or look at it in a hex editor indicates this is not zipped content.

I am really going to have to investigate how this file was created in the first place, and why Excel is saving an apparent Office 2007 is saving the document as OLE. Is it possible that Excel will use the OLE format if there is a feature not supported by the OOXML format?

If any of the developers want to look at the file, I will happily supply it.

André-John


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?

Posted by Nick Burch <ni...@alfresco.com>.
On Thu, 15 Apr 2010, Andre-John Mas wrote:
> What I don't seem to understand is why the Excel 2003 parser (HSSF) is 
> being used when I call WorkbookFactory.create() on this file, instead of 
> the Excel 2007 parser (XSSF). The file ends in '.xlsx'.

Since you got the output that you did from POIFSLister, it's clear that 
your document in an OLE2 document, not an ooxml one. That's also why you 
get the exception you do when you try to load it with XSSF.

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?

Posted by MSB <ma...@tiscali.co.uk>.
Morning Andre,

I cannot help with the original porblem, but do not be confused about the
file extension. It is quite likely that the application or person who
generated the file decided that was the correct extension or it could even
have been changed later following creation. The Office applications are very
tolerant of this - rtf files with .doc extension and so on.

If you want to convince yourself that you are really dealing with an Excel
2007, zipped xml file archive, then all you need to do is use a utility such
as WinRAR or PKUnzip to open the troublesome .xlsx file. If it really is a
valid SpreadsheetML file, then you will be able to see a collection of files
and folders.

The one other format that I can think of is the older - and long abandoned -
2003 xml file format. Can you open the file using a simple text editor - not
something like Word but a really simple editor such as Notepad? If you can
and you see xml markup then you do have an Excel 2003 xml format file.

Yours

Mark B


Andre-John Mas-4 wrote:
> 
> What I don't seem to understand is why the Excel 2003 parser (HSSF) is
> being used when I 
> call WorkbookFactory.create() on this file, instead of the Excel 2007
> parser (XSSF). The
> file ends in '.xlsx'.
> 
> I decided to force the behaviour, by testing for the file ending:
> 
> if ( file.getName().endsWith(".xlsx")) {
>    wb = new XSSFWorkbook(in);
> }
> else {
>    wb = new HSSFWorkbook(in);
> }
> 
> but that doesn't help:
> 
> org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open
> the specified file:
> 'C:\DOCUME~1\ajmas\LOCALS~1\Temp\poifiles\poi-ooxml--319334477.tmp'
>       at
> org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:102)
>       at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:199)
>       at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:178)
>       at org.apache.poi.util.PackageHelper.open(PackageHelper.java:53)
>       at
> org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:176)
>       ...
> 
> Any ideas?
> 
> André
> 
> 
> On 15-Apr-2010, at 18:27, Andre-John Mas wrote:
> 
>> This is the tree I am getting:
>> 
>> Root Entry -
>>  EncryptionInfo
>>  EncryptedPackage
>>  _DataSpaces -
>>    TransformInfo -
>>      StrongEncryptionTransform -
>>        Primary <(0x06)Primary>
>>    Version
>>    DataSpaceMap
>>    DataSpaceInfo -
>>      StrongEncryptionDataSpace
>> 
>> 
>> On 15-Apr-2010, at 09:26, Nick Burch wrote:
>> 
>>> On Thu, 15 Apr 2010, Andre-John Mas wrote:
>>>> I am trying to read an Excel 2007 file and I running into the following
>>>> issue:
>>>> 
>>>> java.lang.IllegalArgumentException: The supplied POIFSFileSystem does
>>>> not contain a BIFF8 'Workbook' entry. Is it really an excel file?
>>> 
>>> Your file isn't in the expected structure. You could try running
>>> org.apache.poi.poifs.dev.POIFS.POIFSLister against it to see what it
>>> contains instead
>>> 
>>> Nick
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>>> For additional commands, e-mail: user-help@poi.apache.org
>>> 
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/The-supplied-POIFSFileSystem-does-not-contain-a-BIFF8-%27Workbook%27-entry.-Is-it-really-an-excel-file--tp28255113p28263612.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?

Posted by Andre-John Mas <aj...@sympatico.ca>.
What I don't seem to understand is why the Excel 2003 parser (HSSF) is being used when I 
call WorkbookFactory.create() on this file, instead of the Excel 2007 parser (XSSF). The
file ends in '.xlsx'.

I decided to force the behaviour, by testing for the file ending:

if ( file.getName().endsWith(".xlsx")) {
   wb = new XSSFWorkbook(in);
}
else {
   wb = new HSSFWorkbook(in);
}

but that doesn't help:

org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open the specified file: 'C:\DOCUME~1\ajmas\LOCALS~1\Temp\poifiles\poi-ooxml--319334477.tmp'
      at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:102)
      at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:199)
      at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:178)
      at org.apache.poi.util.PackageHelper.open(PackageHelper.java:53)
      at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:176)
      ...

Any ideas?

André


On 15-Apr-2010, at 18:27, Andre-John Mas wrote:

> This is the tree I am getting:
> 
> Root Entry -
>  EncryptionInfo
>  EncryptedPackage
>  _DataSpaces -
>    TransformInfo -
>      StrongEncryptionTransform -
>        Primary <(0x06)Primary>
>    Version
>    DataSpaceMap
>    DataSpaceInfo -
>      StrongEncryptionDataSpace
> 
> 
> On 15-Apr-2010, at 09:26, Nick Burch wrote:
> 
>> On Thu, 15 Apr 2010, Andre-John Mas wrote:
>>> I am trying to read an Excel 2007 file and I running into the following issue:
>>> 
>>> java.lang.IllegalArgumentException: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?
>> 
>> Your file isn't in the expected structure. You could try running org.apache.poi.poifs.dev.POIFS.POIFSLister against it to see what it contains instead
>> 
>> Nick
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?

Posted by Nick Burch <ni...@alfresco.com>.
On Thu, 15 Apr 2010, Andre-John Mas wrote:
> This is the tree I am getting:
>
> Root Entry -
>  EncryptionInfo
>  EncryptedPackage
>  _DataSpaces -
>    TransformInfo -
>      StrongEncryptionTransform -
>        Primary <(0x06)Primary>
>    Version
>    DataSpaceMap
>    DataSpaceInfo -
>      StrongEncryptionDataSpace

I've not seen a file like that before!

It's certainly not a regular excel file. It would appear to be some sort 
of fully encrypted document - it's not even like the excel protected 
documents normally look

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?

Posted by Andre-John Mas <aj...@sympatico.ca>.
This is the tree I am getting:

Root Entry -
  EncryptionInfo
  EncryptedPackage
  _DataSpaces -
    TransformInfo -
      StrongEncryptionTransform -
        Primary <(0x06)Primary>
    Version
    DataSpaceMap
    DataSpaceInfo -
      StrongEncryptionDataSpace


On 15-Apr-2010, at 09:26, Nick Burch wrote:

> On Thu, 15 Apr 2010, Andre-John Mas wrote:
>> I am trying to read an Excel 2007 file and I running into the following issue:
>> 
>> java.lang.IllegalArgumentException: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?
> 
> Your file isn't in the expected structure. You could try running org.apache.poi.poifs.dev.POIFS.POIFSLister against it to see what it contains instead
> 
> Nick
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' entry. Is it really an excel file?

Posted by Nick Burch <ni...@alfresco.com>.
On Thu, 15 Apr 2010, Andre-John Mas wrote:
> I am trying to read an Excel 2007 file and I running into the following 
> issue:
>
> java.lang.IllegalArgumentException: The supplied POIFSFileSystem does 
> not contain a BIFF8 'Workbook' entry. Is it really an excel file?

Your file isn't in the expected structure. You could try running 
org.apache.poi.poifs.dev.POIFS.POIFSLister against it to see what it 
contains instead

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org