|
What line of code in loveladyTest is line 21? It's telling youfew
something
somewhere is null.
--
James R. Perkins
http://twitter.com/the_jamezp
On Mon, Aug 24, 2009 at 08:40, Dennis Lovelady <iseries@xxxxxxxxxxxx>
wrote:
Happy Monday!
I've been using the POI 3.2-FINAL objects for quite a while on a
particularsystems, and have now run across a problem for which I find nosolution; I
wonder if I might get some guidance from this list.
I can open, read and digest all the rows and cells on one
spreadsheetspreadsheet on a V5R3 system. But when I move that same
to abelow)
V5R4 system, I receive the subject message (stack trace below). Toisolate
the cause of this issue, I used a simple JAVA program (source
andno
randid
it on the same (failing) system, and received the same failure. I
check
all the normal stuff (like ASCII-mode FTP, et cetera), and I find
tweak.problem. I can FTP that same file back to the V5R3 system, andprocess it
without problem. I wonder if this might be the result of someconfigurable
parameter within iSeries Java, but am at a loss as to what to
constructspreadsheets
One last thing: the V5R4 system is capable of reading other
I've tried without issue. I don't want to bring this to the POIcommunity
(yet) due to the suspicion that this is an iSeries-specific or
configuration-specific issue.
Would appreciate any help.
Stack:
org.apache.poi.hssf.record.RecordFormatException: Unable to
java.lang.RuntimeException.<init>(RuntimeException.java:43)record
instance, the following exception occured: null
at java.lang.Throwable.<init>(Throwable.java:195)
at java.lang.Exception.<init>(Exception.java:41)
at
org.apache.poi.hssf.record.RecordFormatException.<init>(RecordFormatExc
at
eptioorg.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.jav
n.java:31)
at
a:237org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.ja
)
at
va:16org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163
0)
at
)org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130
at
)the
at loveladyTest.main(loveladyTest.java:21)
Java program:
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFRow;
/**
* A simple POI example of opening an Excel spreadsheet
* and writing its contents to the command line.
* @author Tony Sintes
*/
public class loveladyTest {
public static void main( String [] args ) {
try {
InputStream input =
loveladyTest.class.getResourceAsStream(
"BreakageMar09Data.xls" );
POIFSFileSystem fs = new POIFSFileSystem( input );
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(0);
// Iterate over each row in the sheet
Iterator rows = sheet.rowIterator();
while( rows.hasNext() ) {
HSSFRow row = (HSSFRow) rows.next();
System.out.println( "Row #" + row.getRowNum() );
// Iterate over each cell in the row and print out
type"cell's content);
Iterator cells = row.cellIterator();
while( cells.hasNext() ) {
HSSFCell cell = (HSSFCell) cells.next();
System.out.println( "Cell #" + cell.getCellNum()
cell.getNumericCellValue()
switch ( cell.getCellType() ) {
case HSSFCell.CELL_TYPE_NUMERIC:
System.out.println(
);cell.getStringCellValue() );
break;
case HSSFCell.CELL_TYPE_STRING:
System.out.println(
break;
default:
System.out.println( "unsuported sell
);part
break;
}
}
}
} catch ( IOException ex ) {
ex.printStackTrace();
}
}
}
Regards,
Dennis E. Lovelady
AIM: delovelady MSN: fastcounter@xxxxxxxxxxxx
<http://www.linkedin.com/in/dennislovelady>
www.linkedin.com/in/dennislovelady --
"Smoking kills. If you're killed, you've lost a very important
ofmailing
yourmailing list
life."
- actress Brooke Shield
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
To post a message email: MIDRANGE-L@xxxxxxxxxxxx--
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.