You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by hl...@ocbcnya.com on 2003/05/15 17:59:35 UTC
Opening workbook error
Hi all,
I've been trying to work on this all day yesterday but couldn't figure
it out. I've put the problem code in an entirely different class to isolate
the problem, but I'm still not sure what I'm missing. I think my POI
installation must not have been complete. I've installed both the POI
libraries and the commons.logging source code in my libraries. I would
appreciate any help anyone can give. Here's the test code:
import java.io.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.poifs.filesystem.*;
class ExcelTest {
public static void main(String args[]) {
String fileName = "c:/ocbc/dev/excelTest/test.xls";
POIFSFileSystem fs = null;
HSSFWorkbook wb = null;
try {
fs = new POIFSFileSystem(new FileInputStream(fileName));
wb = new HSSFWorkbook(fs);
}
catch (Exception e) {
System.out.println (e.toString());
System.exit(1);
}
}
}
And the stack trace:
java.lang.ExceptionInInitializerError
at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<clinit>(HSSFWorkbook.java:113)
at ExcelTest.main(ExcelTest.java:14)
Caused by: org.apache.commons.logging.LogConfigurationException:
java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.LogFactoryImpl
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:609)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:561)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:360)
at org.apache.poi.util.POILogFactory.<clinit>(POILogFactory.java:76)
... 2 more
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.LogFactoryImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:571)
... 6 more
Exception in thread "main"