ERROR:java.lang.NoClassDefFoundError: org/apache/poi/hssf/util/HSSFColor$WH

hi All

please help me in solving that problem, this error occurs when running my project, its for generating report using jasper report tool, exact at the line

"JRXlsExporter exporter = new JRXlsExporter();"

her is the code

try

{

JasperCompileManager.compileReport("E:/jasper_template/report2.jrxml");

tteset = JasperFillManager.fillReport(jasperReport,new HashMap(),new JRResultSetDataSource(rset));

JasperExportManager.exportReportToPdfFile(tteset,"E:/test.pdf");

JRXlsExporter exporter =new JRXlsExporter();

exporter.setParameter(JRExporterParameter.JASPER_P RINT,tteset);

exporter.setParameter(JRExporterParameter.OUTPUT_F ILE_NAME,"E:/test.xls");

exporter.exportReport();

}

catch (JRException e)

{

e.printStackTrace();

}

[1180 byte] By [mohaba] at [2007-11-27 3:57:09]
# 1
Include jar in classpath.
Satish_Patila at 2007-7-12 9:01:27 > top of Java-index,Java Essentials,Java Programming...
# 2

i included all the following jars

classes12.jar;

commons-beanutils-1.5.jar;

commons-collections-2.1.jar;

commons-digester-1.7.jar;

commons-logging-1.0.2.jar;

ireport.jar;

itext-1.3.1.jar;

jasperreports-1.2.6.jar;

jasperreports-1.2.8.jar;

jcommon-1.0.0.jar;

jfreechart-1.0.0.jar;

jxl-2.6.jar;

if u know the missing jar , then please tell me

thank you

mohaba at 2007-7-12 9:01:27 > top of Java-index,Java Essentials,Java Programming...
# 3
Search for HSSFColor$WH class in org.apache.poi.hssf.util package
Satish_Patila at 2007-7-12 9:01:27 > top of Java-index,Java Essentials,Java Programming...
# 4
You need to include poi.I use poi and have the following included:poi.2.5.1-final-20040804.jarpoi-contrib.2.5.1-final-20040804.jarpoi-scratchpad.2.5.1-final-20040804.jar
ChristopherAngela at 2007-7-12 9:01:27 > top of Java-index,Java Essentials,Java Programming...
# 5
Use one of thejasperreports-1.2.6.jar;jasperreports-1.2.8.jar;to avoid jar conflict
Satish_Patila at 2007-7-12 9:01:27 > top of Java-index,Java Essentials,Java Programming...
# 6

> I think you have to include jasperreports-1.2.7.jar in the classpath

What?

exporter.setParameter(JRExporterParameter.OUTPUT_F ILE_NAME,"E:/test.xls");

mentions a file test.xls which I assume naturally is an excel file.

POI can be used to modify/read excel files in java.

HSSFColor is used in POI

This leads me to the conclusion that POI is missing from the classpath.

How on earth did you come to your conclusions?

ChristopherAngela at 2007-7-12 9:01:27 > top of Java-index,Java Essentials,Java Programming...