Bug 59919 - RuntimeException: Unexpected record type (org.apache.poi.hssf.record.HyperlinkRecord)
Summary: RuntimeException: Unexpected record type (org.apache.poi.hssf.record.Hyperlin...
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.13-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2016-08-01 08:13 UTC by Anand
Modified: 2017-02-17 05:43 UTC (History)
1 user (show)

passing unit test (119.47 KB, application/gzip)
2016-08-01 17:38 UTC, Javen O'Neal
MY_XLS_FILE (150.10 KB, application/x-gzip)
2016-08-02 06:10 UTC, Anand

Note You need to log in before you can comment on or make changes to this bug.
Description Anand 2016-08-01 08:13:51 UTC
java.lang.RuntimeException: Unexpected record type (org.apache.poi.hssf.record.HyperlinkRecord)
	at com.dclear.cmn.core.parser.reader.xls.XlsLineReader.<init>(XlsLineReader.java:86)
	at com.dclear.cmn.core.parser.reader.XlsDataReader.setFileDetails(XlsDataReader.java:42)
	at com.dclear.cmn.core.parser.config.ConfigFileReader.configureFeedIterator(ConfigFileReader.java:135)
	at com.dclear.cmn.core.parser.config.ConfigFileReader.getFeedIterator(ConfigFileReader.java:116)
	at com.dclear.cmn.core.parser.GenericFeedReader.createDataProcessor(GenericFeedReader.java:53)
	at com.dclear.cmn.core.parser.GenericFeedReader.getFeedIterator(GenericFeedReader.java:48)
	at com.dclear.udl.core.task.ParserTask.run(ParserTask.java:139)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Unexpected record type (org.apache.poi.hssf.record.HyperlinkRecord)
	at org.apache.poi.hssf.record.aggregates.RowRecordsAggregate.<init>(RowRecordsAggregate.java:97)
	at org.apache.poi.hssf.model.InternalSheet.<init>(InternalSheet.java:217)
	at org.apache.poi.hssf.model.InternalSheet.createSheet(InternalSheet.java:156)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:354)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:124)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:279)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:250)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:229)
	at com.dclear.cmn.core.parser.reader.xls.XlsLineReader.<init>(XlsLineReader.java:72)
	... 7 more
Comment 1 Anand 2016-08-01 08:15:40 UTC
Hi All,

I am also currently facing above issue. The code changes that we are planning to do 

case HyperlinkRecord.sid:

The file that we are trying to load which is given the above mentioned is available at .


Please let us know will this fix work and what will be the impact of this change.

Thanks in Advance.

Anand Mahajan
Comment 3 Javen O'Neal 2016-08-01 17:38:23 UTC
Created attachment 34084 [details]
passing unit test

I was unable to reproduce this problem in the latest trunk build (almost 3.15 beta 3).
Comment 4 Javen O'Neal 2016-08-01 17:39:28 UTC
Please retest in the lastest version of POI (3.15 beta 3 when it comes out) and reopen this bug if you are still having issues with the referenced file.
Comment 5 Javen O'Neal 2016-08-02 01:38:58 UTC
My unit test also passes for 3.13. Could you please submit a unit test demonstrating the problem?
Comment 6 Anand 2016-08-02 06:10:58 UTC
Created attachment 34088 [details]

Dear Javen,

Thanks for reply.

Exact file attached where error is occur.
Please take 29072016.tar.gz attached file and verify it.

Thanks and Regards,
Anand Mahajan
Comment 7 Anand 2016-08-02 07:09:45 UTC
Some time file have Hyperlink Records.
Comment 8 Javen O'Neal 2016-08-02 08:15:20 UTC
I was able to reproduce it with attachment 34088 [details] on the latest trunk build.

In order to make sure this issue doesn't reoccur, would you be able to generate a file with just a couple rows that demonstrates the same problem for our unit tests?

The workbook metadata properties suggests the file was generated by Crystal Decisions (part of Crystal Reports?). When I resave the file in LibreOffice, I am unable to reproduce the problem.
Comment 9 Anand 2016-08-02 09:32:28 UTC
Hi Javen,

The file download from public site(exchange) hence Crystal Reports is not with me to cut it. 
For me too opening and saving file again did not produce the issue. I was using Microsoft excel for saving file. However we wont be able to add manual interruption for every day task hence its creating issue on our side.
Comment 10 Javen O'Neal 2016-08-02 15:36:10 UTC
(In reply to Anand from comment #9)
> For me too opening and saving file again did not produce the issue. I was
> using Microsoft excel for saving file.

Sounds like a bug in the way that Crystal Reports saves files.
Does the Crystal Reports-generated file pass Microsoft's Binary Format Validator?
Comment 11 Javen O'Neal 2017-02-17 05:43:28 UTC
Closing as WORKSFORME. Please reopen if you can show that POI incorrectly raises an exception on a valid workbook.