Bug 49219 - Not enough data (0) to read requested (1) bytes error on Excel read
Not enough data (0) to read requested (1) bytes error on Excel read
Status: RESOLVED FIXED
Product: POI
Classification: Unclassified
Component: HSSF
3.7-dev
PC Windows XP
: P2 normal with 4 votes (vote)
: ---
Assigned To: POI Developers List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-04-29 08:24 UTC by Erhan Yigitbasi
Modified: 2011-03-18 11:52 UTC (History)
0 users



Attachments
sample excel file that gives error (252.50 KB, application/x-msexcel)
2010-04-29 08:24 UTC, Erhan Yigitbasi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erhan Yigitbasi 2010-04-29 08:24:50 UTC
Created attachment 25371 [details]
sample excel file that gives error

When reading the following file which contains macros POI gives the following error.


org.apache.poi.hssf.record.RecordFormatException: Not enough data (0) to read requested (1) bytes
	at org.apache.poi.hssf.record.RecordInputStream.checkRecordPosition(RecordInputStream.java:215)
	at org.apache.poi.hssf.record.RecordInputStream.readByte(RecordInputStream.java:223)
	at org.apache.poi.hssf.record.RecordInputStream.readUByte(RecordInputStream.java:253)
	at org.apache.poi.hssf.record.ExternalNameRecord.<init>(ExternalNameRecord.java:148)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
	at org.apache.poi.hssf.record.RecordFactory$ReflectionRecordCreator.create(RecordFactory.java:56)
	at org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:263)
	at org.apache.poi.hssf.record.RecordFactoryInputStream.readNextRecord(RecordFactoryInputStream.java:270)
	at org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:236)
	at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:392)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:276)
	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 com.amwebexpert.tags.workbook.model.InMemoryWorkbook.loadWorkbook(InMemoryWorkbook.java:180)
	at com.amwebexpert.tags.workbook.model.InMemoryWorkbook.<init>(InMemoryWorkbook.java:121)
	at com.amwebexpert.tags.workbook.model.InMemoryWorkbook.<init>(InMemoryWorkbook.java:92)
	at com.amwebexpert.tags.workbook.model.InMemoryWorkbookWebUtils.getInMemoryWorkbook(InMemoryWorkbookWebUtils.java:62)
	at com.amwebexpert.tags.workbook.WorkbookTag.doStartTag(WorkbookTag.java:81)
	at org.apache.jsp.demo01_jsp._jspx_meth_wkb_005fworkbook_005f0(demo01_jsp.java:125)
	at org.apache.jsp.demo01_jsp._jspService(demo01_jsp.java:84)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:595)
Comment 1 Nick Burch 2011-03-18 11:52:15 UTC
Looking at the spec closely, it seems that the DDE Link operation part is optional, and we assumed it was there.

Fixed in r1082958.