Bug 44929

Summary: Importing the attached doc will cause exception.
Product: POI Reporter: Ernie Tam <etam>
Component: POI OverallAssignee: POI Developers List <dev>
Status: RESOLVED WONTFIX    
Severity: critical    
Priority: P1    
Version: 3.0-FINAL   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: The input file which will cause exception
Stack traces for this bug on various recent POI versions

Description Ernie Tam 2008-05-02 19:21:38 UTC
The attached excel sheet will fail in release 3.0.2 final but worked well in 2.5.1 final.

The work around is to create a new spread sheet, and copy data from the existing spread sheet to the new one. Then the new one will not trigger the following exception.


org.apache.poi.hpsf.IllegalPropertySetDataException: The property set claims to have a size of 16 bytes. However, it exceeds 16 bytes.
        at org.apache.poi.hpsf.Section.<init>(Section.java:255)
        at org.apache.poi.hpsf.PropertySet.init(PropertySet.java:454)
        at org.apache.poi.hpsf.PropertySet.<init>(PropertySet.java:249)
        at org.apache.poi.hpsf.PropertySetFactory.create(PropertySetFactory.java:61)
        at org.apache.poi.POIDocument.getPropertySet(POIDocument.java:97)
        at org.apache.poi.POIDocument.readProperties(POIDocument.java:74)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:171)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:259)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:240)
        at com.lucidera.als.olap.xlloader.AlsXLOlapLoader.getWorkbook(AlsXLOlapLoader.java:209)
        at com.lucidera.als.olap.xlloader.AlsXLOlapLoader.execute(AlsXLOlapLoader.java:121)
        at com.lucidera.als.impl.AlsSessionImpl.executeActionOn(AlsSessionImpl.java:839)
        at com.lucidera.als.impl.AlsSessionImpl.executeActionOn(AlsSessionImpl.java:818)
        at com.lucidera.als.impl.AlsSessionImpl.importOlapObjectsFromXLS(AlsSessionImpl.java:557)
        at com.lucidera.webservices.impl.design.DesignServicesBaseAPIImpl.importOLAPDefinition(DesignServicesBaseAPIImpl.java:561)
        at com.lucidera.webservices.impl.design.DesignServicesBaseAPIImpl.importObjects(DesignServicesBaseAPIImpl.java:467)
        at com.lucidera.webservices.impl.design.DesignServicesBaseAPIImpl.importObject(DesignServicesBaseAPIImpl.java:426)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.wsf.container.jboss40.DefaultInvocationHandler.invoke(DefaultInvocationHandler.java:101)
        at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:220)
        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:414)
        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:273)
        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:190)
        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:123)
        at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:495)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
        at java.lang.Thread.run(Thread.java:595)
Comment 1 Ernie Tam 2008-05-02 19:22:36 UTC
Created attachment 21909 [details]
The input file which will cause exception
Comment 2 Rainer Klute 2008-05-02 22:10:24 UTC
As the exception's message clearly states, the error is in your file, not in the HPSF component.
Comment 3 Ernie Tam 2008-05-02 23:29:58 UTC
The same file works in release 2.5.1, and it is a legitimate Excel file.

We receive the exception after we migrated to 3.0.2.

Re-open the bug so that there is more information. I believer there are other people having this problem.
Comment 4 Ernie Tam 2008-05-03 09:04:38 UTC
Well, propably not quite so legitimate, because, as the exception
message reveals, the property set size is not correct.
It means that HPSF added one more consistency check when reading
property set streams.

If you care just about the document contents and not about the
properties, it should be possible to just ignore the exception.

Comment 5 Josh Micich 2008-05-03 12:59:38 UTC
(In reply to comment #1)
> The input file which will cause exception

I tried attachment (id=21909) with various versions of POI (2.5.1, 3.0.2, 3.1-beta1, svn trunk) and found that it works on none.  The main problem is that it does not have a 'Workbook' directory entry, but instead has 'Book'.  As far as I can tell that makes it BIFF5 format, which POI does not support.

In POI 3.0.2 the error looks different (IllegalPropertySetDataException) because of the call to readProperties() from HSSFWorkbook.<init>(HSSFWorkbook.java:171).  This call was added after 2.5.1 but removed before 3.1-beta1.  I am not sure of the details but that change was made in bug 44491 (svn r633118).

To help a little with this bug, I made a change to HSSFWorkbook to give a clearer error message when attempting to read a prior BIFF version. This was applied in svn r653117.
Comment 6 Josh Micich 2008-05-03 13:01:23 UTC
Created attachment 21916 [details]
Stack traces for this bug on various recent POI versions

Note - the failure on v2.5.1 is very similar to that of 3.1-beta1.