Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes I/O and Streams and the fly likes ClassCastExcepiton Using POI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "ClassCastExcepiton Using POI" Watch "ClassCastExcepiton Using POI" New topic
Author

ClassCastExcepiton Using POI

chetan
Greenhorn

Joined: Aug 13, 2002
Posts: 15
Hi,

I am reading an excel file using POI api I am getting Classcast exception for the below line..

HSSFWorkbook wb1 = new HSSFWorkbook();
POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(filename);

Below is the Excepiton I am getting ..Please let me know if anybody has comeacross this type of error and any solution to the same..

java.lang.ClassCastException
at java.util.TreeMap.compare(TreeMap.java:1081)
at java.util.TreeMap.put(TreeMap.java:459)
at org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate.insertCell(ValueRecordsAggregate.java:102)
at org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate.construct(ValueRecordsAggregate.java:167)
at org.apache.poi.hssf.model.Sheet.createSheet(Sheet.java:224)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:216)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:174)


Thanks In Advance

Chetan


Thanks<br />chets
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassCastExcepiton Using POI