I am trying to read Excel using Apache POI which is deployed as bundle in Karaf.
Used POI versions as per order:
- poi-3.11.jar
- poi-ooxml-3.11.jar
- poi-ooxml-schemas-3.11.jar
feature.xml snippet(For wrapping the bundles in Karaf):
<bundle>wrap:mvn:org.apache.poi/poi/3.11</bundle>
<bundle>wrap:mvn:org.apache.poi/poi-ooxml/3.11</bundle>
<bundle>wrap:mvn:org.apache.poi/poi-ooxml-schemas/3.11</bundle>
pom.xml(dependency jars)
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.11<version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.11<version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.11</version>
</dependency>
Above jars used as dependency in project as well as bundles in Karaf
.
Tried servicemix
version of POI. But it also doesn't help.
I understand NoClassDefFoundError
is runtime error, which is caused while the class is not found at runtime. Please give me resolution for this issue.
Stack Trace:
java.lang.NoClassDefFoundError: org/apache/poi/POIXMLDocument
at java.lang.ClassLoader.defineClass1(Native Method)[:1.8.0_25]
at java.lang.ClassLoader.defineClass(Unknown Source)[:1.8.0_25]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2128)
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1432)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
at java.lang.ClassLoader.loadClass(Unknown Source)[:1.8.0_25]
at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1317)
at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1481)
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1427)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
at java.lang.ClassLoader.loadClass(Unknown Source)[:1.8.0_25]