• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
*******************

*******************
 
Liar, liar, pants on fire! refreshing plug:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic