Bug 58240 - POI generated xls file fails validation
Summary: POI generated xls file fails validation
Status: REOPENED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.12-FINAL
Hardware: PC Linux
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-12 15:15 UTC by alexander.stoev
Modified: 2016-04-10 11:16 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alexander.stoev 2015-08-12 15:15:55 UTC
I have XLS file generated with POI (either 3.11 or 3.12). File is OK if I open it with Open Office or Google Drive but fails in MS Office. Found that it fails with the MS Validator(http://www.microsoft.com/en-us/download/details.aspx?id=26794) with :



<BFFValidation path="NAME.xlsx" datetime="08/12/15 07:44:35" result="FAILED">
  <ParseStack>
    <Type builtinType="Docfile" docName="MS-XLS" sectionTitle="Compound File" msdnLink="http://msdn.microsoft.com/en-us/library/b91df1c9-6bfa-4ab4-8218-7bb0d73624ca">
      <Info>Built-in type "Docfile": The root storage object of an OLE compound file. For more information, see http://msdn.microsoft.com/en-us/library/dd942138.aspx.</Info>
    </Type>
    <Type builtinType="Stream" docName="MS-XLS" sectionTitle="Stream" msdnLink="http://msdn.microsoft.com/en-us/library/f67ac5ed-b0a7-4b2c-9b7a-28933eeaac7e" streamName="Workbook" streamOffset="0" hexStreamOffset="0x0">
      <Info>Built-in type "Stream": Any stream object for OLE compound files. The entire file contents for other files.</Info>
    </Type>
    <Type docName="MS-XLS" sectionTitle="Workbook Stream (Workbook)" msdnLink="http://msdn.microsoft.com/en-us/library/f682f4b0-8c6b-444e-83f8-52d156f1e8ba" streamName="Workbook" streamOffset="2747" hexStreamOffset="0xabb"/>
    <Type docName="MS-XLS" sectionTitle="Workbook Stream (Workbook)" msdnLink="http://msdn.microsoft.com/en-us/library/f682f4b0-8c6b-444e-83f8-52d156f1e8ba" streamName="Workbook" streamOffset="2747" hexStreamOffset="0xabb"/>
    <Type docName="MS-XLS" sectionTitle="Substream" msdnLink="http://msdn.microsoft.com/en-us/library/dd947025(v=office.12).aspx" streamName="Workbook" streamOffset="2767" hexStreamOffset="0xacf"/>
    <Type docName="MS-XLS" sectionTitle="Record" msdnLink="http://msdn.microsoft.com/en-us/library/170e90ce-87d7-4758-9331-dcf14cd72388" streamName="Workbook" streamOffset="2767" hexStreamOffset="0xacf"/>
    <Type docName="MS-XLS" sectionTitle="Index" sectionNumber="2.4.144" msdnLink="http://msdn.microsoft.com/en-us/library/67C20922-0427-4C2D-96CC-2267D3F09E8C" streamName="Workbook" streamOffset="2771" hexStreamOffset="0xad3"/>
    <Type docName="MS-OSHARED" sectionTitle="FilePointer" msdnLink="http://msdn.microsoft.com/en-us/library/dd904963(v=office.12).aspx" streamName="Workbook" streamOffset="2783" hexStreamOffset="0xadf" childId="4" hexChildId="0x4"/>
  </ParseStack>
  <LastData><![CDATA[
00 00 00 00 -- -- -- --  -- -- -- -- -- -- -- --  ....
]]></LastData>
</BFFValidation>


So it seem POI has generated incompatible file. 
The content is quite simple - single sheet with two rows (first one bold) and several cells.
Any suggestions?
Thanks
Aleksandar
Comment 1 Nick Burch 2015-08-12 15:20:14 UTC
Can you try again with a recent nightly build / wait a week or so then try again with 3.13 beta 2?
Comment 2 alexander.stoev 2015-08-12 18:30:13 UTC
I tried with the latest available maven dependency 3.13-beta1 - same result.
Comment 3 Nick Burch 2015-08-12 18:44:04 UTC
As requested:

> Can you try again with a recent nightly build / wait a week or so then try again with 3.13 beta 2?
Comment 4 alexander.stoev 2015-08-12 19:12:24 UTC
OK, same with the nightly build from today - https://builds.apache.org/job/POI/781/

Best,
Aleksandar
Comment 5 alexander.stoev 2015-08-13 07:15:44 UTC
Hey,

I played a bit to see if I can find some better reason - nope.
I cut the code to just this :
 Workbook workbook = new HSSFWorkbook();
 Sheet sheet = workbook.createSheet();
 workbook.write(stream);
 workbook.close();
The validation still fails. I wouldn't care if MS Office didn't refuses to load the file.
It runs under JBoss wildfly-8.1.0.Final with jdk1.7.0_75, same with OpenSuse(13.1) and Ubuntu (both x64).
The situation is really strange ...

Best,
Aleksandar
Comment 6 Dominik Stadler 2015-09-14 16:16:14 UTC
I tried the steps you list, the resulting document opens just fine in Excel for me.

I also tried the validator, it reported FAILED similar to your output, however I tried a few other documents and many fail, even some that I saved using Excel itself, not sure how good the validation matches to what Excel actually allows...

Any chance that an older version of poi is pulled in here for some reason? It seems like it is somehow only happening for you here.
Comment 7 Dominik Stadler 2016-04-10 10:17:39 UTC
No update for some time therefor I am resolving this for now until we get more information that allows us to reproduce this. We primarily depend on Excel itself to verify files.
Comment 8 alexander.stoev 2016-04-10 11:16:57 UTC
Hello,

what other information do you need to have a look at the issue. As described the file generated fails the MS validation.

Best,
Aleksandar