Bug 7421 - Trouble creating a HSSFWorkbook
Summary: Trouble creating a HSSFWorkbook
Status: RESOLVED DUPLICATE of bug 7054
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 1.0.2
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-24 23:45 UTC by Justin
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin 2002-03-24 23:45:17 UTC
Can not create a HSSFWorkbook.  Code compliles o.k. but I get the following 
error at run time:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Basi
cConfigurator
        at net.sourceforge.poi.hssf.HSSFLog.configure(HSSFLog.java:139)
        at net.sourceforge.poi.hssf.HSSFLog.<init>(HSSFLog.java:102)
        at net.sourceforge.poi.hssf.model.Workbook.<clinit>(Workbook.java:131)
        at net.sourceforge.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.j
ava:127)
        at ExcelTest.main(ExcelTest.java:11)


The code that generates this error is as follows:

//~Create a workbook.
HSSFWorkbook wb = new HSSFWorkbook();

//~Name the worksheets. (Three are created by default)
wb.setSheetName(0,"First");
wb.setSheetName(1,"Second");
wb.setSheetName(2,"Third");

//~Output the workbook to file.
try{
   FileOutputStream out = new FileOutputStream("D:\\JavaSource\\excelTest.xls");
   wb.write(out);
   out.close();
}catch(FileNotFoundException fnfe){
   System.out.println("FileNotFoundException: " + fnfe);
}catch(IOException ioe){ 
   System.out.println("IOException: " + ioe);
}

Any help with this problem would be much appreciated.
Justin.
Comment 1 Andy Oliver 2002-03-25 00:04:46 UTC
This has been fixed in CVS.  Reporter needs a copy of Log4J which was not
included in the distribution.  Furthermore for 1.0.2 he'll need the latest
non-beta release.

-Andy

*** This bug has been marked as a duplicate of 7054 ***