Exception "org.apache.poi.util.RecordFormatException: Not enough data (0) to read requested (2)" occurred while compiling spreadsheet decision tables.

Solution Unverified - Updated -

Issue

When I build a maven project containing spreadsheet decision tables, org.apache.poi.util.RecordFormatException occurred like below occurred.

org.apache.poi.util.RecordFormatException: Not enough data (0) to read requested (2) bytes
    at org.apache.poi.hssf.record.RecordInputStream.checkRecordPosition(RecordInputStream.java:246)
    at org.apache.poi.hssf.record.RecordInputStream.readShort(RecordInputStream.java:265)
    at org.apache.poi.hssf.record.common.UnicodeString.<init>(UnicodeString.java:74)
    at org.apache.poi.hssf.record.SSTDeserializer.manufactureStrings(SSTDeserializer.java:57)
    at org.apache.poi.hssf.record.SSTRecord.<init>(SSTRecord.java:257)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at org.apache.poi.hssf.record.RecordFactory$ReflectionConstructorRecordCreator.create(RecordFactory.java:84)
    at org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:339)
    at org.apache.poi.hssf.record.RecordFactoryInputStream.readNextRecord(RecordFactoryInputStream.java:289)
    at org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:255)
    at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:488)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:343)
    at org.apache.poi.hssf.usermodel.HSSFWorkbookFactory.createWorkbook(HSSFWorkbookFactory.java:64)
    at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:167)
    at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:112)
    at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:253)
    at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:221)
    at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:105)
    at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:113)
    at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:86)
    at com.example.spreadsheet_tools.SpreadsheetToDrl.main(SpreadsheetToDrl.java:19)

Environment

  • Red Hat Process Automation Manager (RHPAM)
    • 7
  • Red Hat Decision Manager (RHDM)
    • 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content