• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to handle RecordInputStreamLeftoverDataException Exception

 
Eshwari Ramaiah
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi....

Im having a problem when i try to access records from an excel sheet using my java

application. The exception is as follows:

org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record

0x1D left 1 bytes remaining still to be read.
at

org.apache.poi.hssf.record.RecordInputStream.hasNextRecord(RecordInputStream.java:156)
at

org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java

:231)
at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:442)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:287)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:250)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:194)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:176)
at ccisapp.LoadGSMData.loadPassiveData(LoadGSMData.java:74)
at xml.DirectoryWatcher.ProcessEvent(DirectoryWatcher.java:57)
at xml.DirectoryWatcher.run(DirectoryWatcher.java:139)
at java.lang.Thread.run(Thread.java:722)


So please anyone tel me how to solve this.... Thanks in advance.
 
Tony Docherty
Saloon Keeper
Posts: 3142
72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like the excel sheet isn't formatted correctly. Is it from Excel or generated by a third party? You could try loading the sheet into Excel and assuming it loads ok save it to a new file.
 
Eshwari Ramaiah
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tony Docherty wrote:Sounds like the excel sheet isn't formatted correctly. Is it from Excel or generated by a third party? You could try loading the sheet into Excel and assuming it loads ok save it to a new file.


Excel sheets is exported by third party application and i am getting this error message when i try to read the records using my application. When try to save the same file with new name, then reload, i am able to read the records. But in my case i cant ask the user to save the file because i should read the reports automatically without user intervention..
 
Tony Docherty
Saloon Keeper
Posts: 3142
72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case the third party app is producing a format that POI doesn't recognize.
I did a quick search for the shown exception and found a similar problem on the POI forum. They suggested that the OP send in details of the issue so they could see if they should change POI to support that format. Maybe posting on the POI forum would be the best bet for you, although I'd search there first as someone may have had the exact same issue as you and there may be a solution posted.
Another thing to check is are you using the latest version of POI.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!