You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2004/04/01 14:27:58 UTC

DO NOT REPLY [Bug 19053] - same ".xls" file can't read - ClassCastException LabelRecord

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=19053>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=19053

same ".xls" file can't read - ClassCastException LabelRecord

perry.tew@cibavision.novartis.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         OS/Version|Other                       |Solaris
           Platform|PC                          |Sun
         Resolution|INVALID                     |
            Summary|same ".xls" file can't read |same ".xls" file can't read
                   |                            |- ClassCastException
                   |                            |LabelRecord
            Version|2.0-dev                     |2.0FINAL



------- Additional Comments From perry.tew@cibavision.novartis.com  2004-04-01 12:27 -------
I can reproduce this error using the 2.5 final binary distribution.
Here is my stack trace.  I will also attach the file that is causing the error,
however Bugzilla keeps timing out on my during the file upload.

This error is strange, because my end user that created this file typcially
never has problems uploading the spreadsheet and all of the sudden the same
spreadsheet is broken.  It opens fine in MS Excel.

I wasn't sure if I should "Reopen" this bug or mark it as "Verified".  If I've
chosen the wrong thing, forgive me.  I'm not very familar with Bugzilla yet.

Thanks for your help!!  I really appreciate it.

Test Case:
package com.novartis.cibavision.websupport.excel;

import junit.framework.TestCase;
import java.io.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;

import java.net.URL;

public class TestClassCastException extends TestCase{

	public TestClassCastException( String name ){ super( name ); }

	public void testClassCastException_Bare() throws Exception{

		String testData =
"com/novartis/cibavision/websupport/excel/test_labelrecord_error.xls";
		URL xlsURL = this.getClass().getClassLoader().getResource( testData );
		HSSFWorkbook workbook = new HSSFWorkbook(new
BufferedInputStream(xlsURL.openStream()));
		HSSFSheet sheet = workbook.getSheet("Calls");
	}

}



Stack Trace:
Testsuite: com.novartis.cibavision.websupport.excel.TestClassCastException
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 1.259 sec

Testcase: testClassCastException_Bare took 1.25 sec
        Caused an ERROR
org.apache.poi.hssf.record.LabelRecord
java.lang.ClassCastException: org.apache.poi.hssf.record.LabelRecord
        at java.util.TreeMap.compare(TreeMap.java:1047)
        at java.util.TreeMap.put(TreeMap.java:449)
        at
org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate.insertCell(ValueRecordsAggregate.java:65)
        at
org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate.construct(ValueRecordsAggregate.java:130)
        at org.apache.poi.hssf.model.Sheet.createSheet(Sheet.java:192)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:174)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:212)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:193)
        at
com.novartis.cibavision.websupport.excel.TestClassCastException.testClassCastException_Bare(Unknown
Source)

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-dev-help@jakarta.apache.org