5

I need to process xlsx Excel documents in an OSGi bundle, but org.apache.servicemix.bundles.poi lacks classes to use 2007 and older formats.

I've created an OSGi bundle (jar file) with full apache poi (including ooxml classes that are absent in official apache poi bundle). I Used this pom.

So, after some efforts I have bundle that I wanted. Now the question is how to use it with my existing bundle? How I can tell it to import what i need? In theory this pom file has <servicemix.osgi.export> that lists namespaces to be exported, and i should be able to import them in my bundle.

рüффп
  • 5,172
  • 34
  • 67
  • 113
Jack
  • 435
  • 2
  • 6
  • 16
  • org.apache.servicemix.bundles.poi lacks classes to use office 2007 formats. selfix – Jack Dec 05 '12 at 18:03
  • Have you looked at Export-package and Import-package, and understand what they mean? Or at least indicate the level of experience you have with OSGi so that people know what kind of problems you might be having. – Andriy Drozdyuk Dec 06 '12 at 10:12
  • Export of my poi bundle has such namespaces: org.apache.poi*;-split-package:=merge-first, org.openxmlformats.schemas*;-split-package:=merge-first, ... etc. – Jack Dec 06 '12 at 13:45
  • In my project I have "build helper maven plugin", it attaches artifacts from features.xml file, where I added dependency to my poi bundle. But when I ran my bundle it's still has ClassNotFoundException "org.apache.poi.ss.usermodel.WorkbookFactory not found by org.apache.servicemix.bundles.poi [737]" Why it looks for "org.apache.servicemix.bundles.poi"? I have not such dependencies at all. It should be looking in my poi bundle. – Jack Dec 06 '12 at 13:51
  • It is very hard to understand your question. Have you taken a look at the manifest of your bundle? What packages does it import? Are you generating the manifest, or have you written it yourself? – Björn Pollex Dec 07 '12 at 10:16
  • Generated. In export-package in manifest it has for example ..,org.apache.poi.ss.usermodel,.. I install and start this poi bundle in osgi, then installing my bundle wich has in import-package org.apache.poi.ss.usermodel.WorkbookFactory but it's unsatisfied requirement: Unsatisfied requirement(s): --------------------------- package:(&(package=org.apache.poi.ss.usermodel.WorkbookFactory)) – Jack Dec 08 '12 at 00:57
  • possible duplicate of [Issue with adding jar in OSGI bundle using ](http://stackoverflow.com/questions/6273061/issue-with-adding-jar-in-osgi-bundle-using-embed-dependency) – Paul Sweatte Jul 09 '14 at 20:19

1 Answers1

0

If all you are doing is wrapping Apache POI with OSGI bundle manifest information, consider using the pre-packaged and freely available Eclipse Orbit project output: http://download.eclipse.org/tools/orbit/downloads/

This site includes multiple versions of Apache POI as well as many other OSS projects as OSGI bundles. And someone besides you maintains them, builds them, and many others also use them.

Paul Bilnoski
  • 556
  • 4
  • 13