Bug 22609

Summary: HSSFWORKBOOK looking for Log4J?
Product: POI Reporter: Norman <normanordas>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: major    
Priority: P3    
Version: 2.0-pre3   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Norman 2003-08-21 02:45:39 UTC
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<clinit>
(HSSFWorkbook.java:115)
	at com.qinteraction.Excel.AnotherExcel.main(AnotherExcel.java:24)
Exception in thread "main" 

This error comes out when I run a simple program using HSSFWORKBOOK.

import java.io.*;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

public class FirstExcelTest {

	public static void main(String[] args) {
		HSSFWorkbook wb = new HSSFWorkbook();
		FileOutputStream fileOut=null;
		try {
			fileOut = new FileOutputStream("c:\\workbook.xls");	
		
			wb.write(fileOut);			 
			fileOut.close();		
		} catch (FileNotFoundException e) {		
			e.printStackTrace();
		} catch (IOException e1) {		
			e1.printStackTrace();
		}        
	}
}

What's wrong with this code??
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<clinit>
(HSSFWorkbook.java:115)
	at com.qinteraction.Excel.AnotherExcel.main(AnotherExcel.java:24)
Exception in thread "main"
Comment 1 Avik Sengupta 2003-10-28 18:17:08 UTC
Just get log4j from http://jakarta.apache.org/log4j and put it in your
classpath. If you have got a source download, running the build will
automatically download it for you. Sorry it took so long to respond, i thought
it was a bigger issue than it is.