使用OSGI框架parsingJava中的excel文件

我试图parsingJava中的Excel文件。 我使用了OSGI框架,并使用了一个karaf容器来部署我的应用程序。 后来我发现我可以使用Apache POIparsing文件。 我试图使用一个Osgi包装,我把依赖项放在pom文件中:

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

当我尝试parsingexcel文件时,我收到以下运行时exception:

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

之后,我为xbean添加了另一个依赖项,如下所示:

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

在我添加了xbean依赖项之后,我的包具有Installed状态,因为它缺less来自“com.sun.javadoc”的依赖项,我无法解决这个缺失的依赖项。

我如何在我的项目中添加Apache POI? 或者我怎么能更容易地parsing一个Excel文件?

谢谢。