Bug 17922 - Can't open excel file with both workbook and sheet protected.
Summary: Can't open excel file with both workbook and sheet protected.
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: PC All
: P3 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-12 16:14 UTC by Jim Shen
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Shen 2003-03-12 16:14:13 UTC
I was trying to open the excel file for read-only using POI.The file was both 
workbook and sheet protected. The file couldn't be opened and caused the 
following exception: 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.j
ava:252)
        at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.
java:190)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:1
81)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:1
53)
        at gov.moh.ohfs.submission.SPSubmissionForm.init(SPSubmissionForm.java:1
05)
        at gov.moh.ohfs.submission.SPSubmission.importSPData(SPSubmission.java:2
52)
        at gov.moh.ohfs.submission.SPSubmission.process(SPSubmission.java:192)
        at gov.moh.ohfs.report.generation.ReportGenController.processFacility(Re
portGenController.java:387)
        at gov.moh.ohfs.report.generation.ReportGenController.main(ReportGenCont
roller.java:621)
Caused by: java.lang.IllegalArgumentException: Illegal length
        at org.apache.poi.util.StringUtil.getFromUnicodeHigh(StringUtil.java:112
)
        at org.apache.poi.hssf.record.FontRecord.fillFields(FontRecord.java:172)

        at org.apache.poi.hssf.record.Record.fillFields(Record.java:143)
        at org.apache.poi.hssf.record.Record.<init>(Record.java:105)
        at org.apache.poi.hssf.record.FontRecord.<init>(FontRecord.java:125)
        ... 13 more
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record ins
tance, the following exception occured: null
        at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.j
ava:265)
        at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.
java:190)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:1
81)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:1
53)
        at gov.moh.ohfs.submission.SPSubmissionForm.init(SPSubmissionForm.java:1
05)
        at gov.moh.ohfs.submission.SPSubmission.importSPData(SPSubmission.java:2
52)
        at gov.moh.ohfs.submission.SPSubmission.process(SPSubmission.java:192)
        at gov.moh.ohfs.report.generation.ReportGenController.processFacility(Re
portGenController.java:387)
        at gov.moh.ohfs.report.generation.ReportGenController.main(ReportGenCont
roller.java:621)
Comment 1 Andy Oliver 2003-03-12 16:26:26 UTC
http://jakarta.apache.org/poi/faq.html#faq-5