Error while trying to write the result of WCC search on an excel using apache poi

93 views Asked by At

I am trying to write the response of GET_SEARCH_RESULTS of WCC on an excel file using apache poi 3.15.But I am getting the following error here.

java.lang.NoClassDefFoundError: org/apache/commons/collections4/multimap/ArrayListValuedHashMap java.lang.ClassNotFoundException:org.apache.commons.collections4.multimap.ArrayListValuedHashMap

I have already included the following jar in the library path.

$COMPONENT_DIR/lib/poi-3.15.jar;
$COMPONENT_DIR/lib/poi-ooxml-3.15.jar;
$COMPONENT_DIR/lib/poi-ooxml-schemas-3.15.jar;
$COMPONENT_DIR/lib/poi-scratchpad-3.15.jar;
$COMPONENT_DIR/lib/xmlbeans-2.6.0.jar;
$COMPONENT_DIR/lib/commons-collections4-4.1.jar;
$COMPONENT_DIR/lib/commons-collections-3.1.jar;
$COMPONENT_DIR/lib/commons-codec-1.3.jar;
$COMPONENT_DIR/lib/commons-httpclient-3.1.jar;
$COMPONENT_DIR/lib/commons-io-1.3.2.jar.

It seems that my WCC (11.1.1.8) is not able to load the class file from commons-collections4-4.1.jar.

I have extracted the ArrayListValuedHashMap.class from the collections jar and added that to the classpath but that did not help either.

Do I need to try with lower versions of POI?

Thanks in advance, Ananda Roy

2

There are 2 answers

0
Ananda Roy On BEST ANSWER

Thank you Jonathan,

We need to provide the jars using the classes folder and not using the lib folder.

This has resolved the issue.

classpath=$COMPONENT_DIR/classes;$COMPONENT_DIR/classes/itextpdf-5.5.6.jar;$COMPONENT_DIR/classes/bcprov-jdk15on-152.jar;

3
Jonathan Hult On

Is the JAR specified on the classpath variable in the component manifest file? Do not use the libpath variable.

classpath=$COMPONENT_DIR/classes;$COMPONENT_DIR/lib/itextpdf-5.5.6.jar;$COMPONENT_DIR/lib/bcprov-jdk15on-152.jar;

A full example can be found here.