1

I tried to parse an excel file in Java. I used the OSGI framework and I used a karaf container to deploy my application. I found out later that I can parse the file using Apache POI. I tried to use an Osgi wrapper and I put the dependency in the pom file:

    <dependency>
        <groupId>org.apache.servicemix.bundles</groupId>
        <artifactId>org.apache.servicemix.bundles.junit</artifactId>
        <version>4.12_1</version>
    </dependency>

Using this when I tried parsing the excel file I received the following runtime exception:

Cannot load org.apache.xmlbeans.impl.SchemaTypeSystemImpl: make sure xbean.jar is on the classpath.

After that I added another dependency for xbean, like this:

    <dependency>
        <groupId>org.apache.servicemix.bundles</groupId>
        <artifactId>org.apache.servicemix.bundles.xmlbeans</artifactId>
        <version>2.6.0_2</version>
    </dependency>

After I added the xbean dependency my bundle has the Installed status because it is missing a dependency from "com.sun.javadoc" and I can't resolve this missing dependency.

How can I add Apache POI in my project? Or how can I parse an excel file more easily?

Thanks.

Dorin
  • 2,167
  • 4
  • 20
  • 32
  • See for example http://stackoverflow.com/questions/29825944/how-to-use-apache-poi-in-osgi or http://stackoverflow.com/questions/23273309/apache-poi-excel-2007-xml-and-osgi for approaches to create OSGi bundles for Apache POI – stempler Nov 21 '16 at 08:07

0 Answers0