tags:

views:

93

answers:

1

Hi,

I have downloaded latest POI 3.5 and tried to run sample application for creation of excel sheet.But it is always giving error while exceuting some code like:

enter code here
    Workbook wb = new XSSFWorkbook(); //or new HSSFWorkbook();

Generated Exception all the time is:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException at ExcelSheetCreation.main(ExcelSheetCreation.java:38)

please give solution for the given exception, why is it giving such kind of exception,as i have included all the types of POI 3.5 jars.? What to include more in the project?

Thanks,

Mishal Shah

A: 

Hi, if you are using Maven, include this dependency:

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.5-FINAL</version>
</dependency>

In particular, the problem is beacause you don't have the Apache xmlbeans dependency

<dependency>
    <groupId>org.apache.xmlbeans</groupId>
    <artifactId>xmlbeans</artifactId>
    <version>2.3.0</version>
</dependency>
aledbf