• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Poi's Upload problem: RecordFormatException

 
Ranch Hand
Posts: 225
Spring Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Salaam/Hi,

All:
Please help us out in the below problem while uploading excel file through POI's api.

The java program throws following exception while reaching at this line POIFSFileSystem fs = new POIFSFileSystem(item.getInputStream());
//item is FileItem object

Exception message:
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance, the following exception occured: null

& In tomcat's catalina window:
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedConstructorAccessor28.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:224)
at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:160)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>HSSFWorkbook.java:1


NB:The excel file is having four sheets with tabular formatted data.


Thank you.

Regards
Baseet Ahmed

******************
Do Make Nikah(Marriage/Wedding ceremony) simple(cheap/easy) so that it becomes difficult(expensive/hard) to do Rape.
-ISLAM-
******************
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the uploaded file byte by byte identical to the source file? That is to say, are you sure it didn't get corrupted? Try to open it with Excel to see if that works.
 
Baseet Ahmed
Ranch Hand
Posts: 225
Spring Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ulf:
are you sure it didn't get corrupted? Try to open it with Excel to see if that works.


Yes Ulf,
Am able to open it in MS Excel without any problem.
But causing the problem while doing upload using POI.

Please suggest any other action to be taken.


Thank you.

Regards
Baseet Ahmed

******************
Do Make Nikah(Marriage/Wedding ceremony) simple(cheap/easy) so that it becomes difficult(expensive/hard) to do Rape.
-ISLAM-
******************
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please check your private messages.

Just to make sure: can you open the file you uploaded after the upload - the copy that's now on the server? Have you made sure that it is byte for byte identical to the original file? Can you open the original file with POI?
[ June 01, 2008: Message edited by: Ulf Dittmer ]
 
Baseet Ahmed
Ranch Hand
Posts: 225
Spring Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf,
Please check your private messages.


Originally posted by Ulf:
can you open the file you uploaded after the upload - the copy that's now on the server? Have you made sure that it is byte for byte identical to the original file?



We have checked the uploaded file(on temp area of tomcat) with our original file. Both are looking same.Probably this is causing problem with particular excel file. Because other excel files are working fine.



Regards
Baseet Ahmed
*******************

*******************
 
rubbery bacon. rubbery tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic