Search code examples
javaexceljxlclassnotfound

java.lang.ClassNotFoundException: jxl.read.biff.BiffException


In my J2EE web project, I have a simple JSP (HomeScreen.jsp) and a servlet class (HomeScreenServlet.java) behind it. This class is calling non-static method (PDFAwt1) from another class (PDFAwt) which in turn calls many other methods from many different classes, as usually happens.

When I try to create an object of the PDFAwt to call PDFAwt1(), I get an exception:

java.lang.ClassNotFoundException: jxl.read.biff.BiffException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
...

Here is a little preview of PDFAwt1()

CreateExcelFile cef = new CreateExcelFile();

ImageConversion.setupPDFToPNG(ReferencePath);
ImageConversion.setupPDFToPNG(NewPath);

File folder = new File(ReferencePath + "/png");
File[] f = folder.listFiles();
File folder1 = new File(NewPath + "/png");
File[] f1 = folder1.listFiles();
...

CreateExcelFile()

import jxl.Workbook;
import jxl.format.Colour;
...
public class CreateExcelFile {
  public CreateExcelFile() {
    try {
      if (!new File("LabelsTemplate.xls").exists()) {
        WritableWorkbook workbook = Workbook.createWorkbook(new File("LabelsTemplate.xls"));
        WritableSheet sheet = workbook.createSheet("Sheet1", 0);
        ... 
    }
  }
}

Not able to find where the problem is exactly.. please help..


Solution

  • Missing jar in your class path, if you are using any IDE, download the respective jar and set it in your build path before running the application. In case you are not using any IDE, add the respective jar's to the lib folder of your web application.