0
in my program

package com.XSLTTransformation;

import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;

import org.apache.poi.openxml4j.exceptions.InvalidFormatException;

import net.sf.jxls.exception.ParsePropertyException;
import net.sf.jxls.transformer.XLSTransformer;

public class XSLTTransformation {
    public static void main(String[] args) {
        Collection<Employee> staff = new HashSet<Employee>();
        staff.add(new Employee("Derek", 35, 3000, 0.30));
        staff.add(new Employee("Elsa", 28, 1500, 0.15));
        staff.add(new Employee("Oleg", 32, 2300, 0.25));
        staff.add(new Employee("Neil", 34, 2500, 0.00));
        staff.add(new Employee("Maria", 34, 1700, 0.15));
        staff.add(new Employee("John", 35, 2800, 0.20));
        Map<String, Collection<Employee>> beans = new HashMap<String, Collection<Employee>>();
        beans.put("employee", staff);
        XLSTransformer transformer = new XLSTransformer();
        try {
            transformer.transformXLS("C:/Users/hussain.a/Desktop/malay/newprojectpocdetails/temp.xls", beans, "C:/Users/hussain.a/Desktop/malay/newprojectpocdetails/proovNYOutput.xls");
        } catch (ParsePropertyException e) 
        {
            e.printStackTrace();
        } catch (InvalidFormatException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}

i find this error

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/jexl2/parser/Node
    at net.sf.jxls.transformer.XLSTransformer.transformWorkbook(XLSTransformer.java:269)
    at net.sf.jxls.transformer.XLSTransformer.transformXLS(XLSTransformer.java:221)
    at net.sf.jxls.transformer.XLSTransformer.transformXLS(XLSTransformer.java:201)
    at com.XSLTTransformation.XSLTTransformation.main(XSLTTransformation.java:27)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.jexl2.parser.Node
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)

i have placed the jar which has this class , i am not able to identify real prob

1 Answers1

2

Add commons-jexl.jar to the CLASSPATH as well ;

Try this link :https://stackoverflow.com/a/8286795/1743852

Community
  • 1
  • 1
Alya'a Gamal
  • 5,624
  • 19
  • 34
  • after that issue , i am now using this jar , org.apache.commons.digester.Digester , though i add it to the class path and can see the jar and the class in the project resources , still i find this error that this class is not found – Hussain Akhtar Wahid 'Ghouri' Apr 03 '13 at 15:36
  • try to put them in `ext` folder in `lib` folder in `java` ,and if you can post the exception i can search with you , i faced this problem before , and i found the solution in the above link , so post me the error and i will try help you – Alya'a Gamal Apr 03 '13 at 19:10