Bug 57857 - Provide an OSGi bundle
Summary: Provide an OSGi bundle
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.12-dev
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
: 53866 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-04-25 01:52 UTC by Nick Burch
Modified: 2016-10-08 17:20 UTC (History)
3 users (show)



Attachments
PAX-EXAM Patch (15.22 KB, patch)
2015-05-14 22:10 UTC, Bob Paulin
Details | Diff
ServiceMix patch (21.58 KB, patch)
2016-10-08 17:20 UTC, Andreas Beeker
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Burch 2015-04-25 01:52:18 UTC
There seems to be increasing demand for an official OSGi bundle version of Apache POI. Some other Apache projects (eg ServiceMix) will sometimes produce their own copy, but not that often, which leaves our OSGi users on older versions or struggling themselves

Through the use of Apache Felix and friends, it ought to be fairly straightforward to build a bundle. Based on the Apache Tika OSGi bundle work of late, we can also include a unit test which checks that the bundle comes up and main parts of the API work
Comment 1 Nick Burch 2015-04-25 02:18:09 UTC
To try the work so far, you can use the "osgi" ant target, or you can build + install the maven poms locally with the "mvn-install" ant target then in the osgi directory run "mvn -Dpoi.version=3.12-beta2 install". However, it isn't yet working...
Comment 2 Bob Paulin 2015-04-26 15:40:50 UTC
So just as a quick experiment I did get the service mix 3.11 bundle running but it did take some toying around:

In the config I had to add:
org.osgi.framework.system.packages.extra=org.w3c.dom,org.w3c.dom.html,org.w3c.dom.traversal,org.w3c.dom.ranges,org.w3c.dom.views

This exposes the JRE classes to the osgi container.


Also below is the log out of the bundles that I had in play to get it to spin up.  The bundles I added are 1, 7-12,16.  
START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (4.6.1)
    1|Active     |    1|Apache Commons Codec (1.9.0)
    2|Active     |    1|Apache Felix Bundle Repository (2.0.2)
    3|Active     |    1|Apache Felix Configuration Admin Service (1.8.2)
    4|Active     |    1|Apache Felix Gogo Command (0.14.0)
    5|Active     |    1|Apache Felix Gogo Runtime (0.12.1)
    6|Active     |    1|Apache Felix Gogo Shell (0.10.0)
    7|Active     |    1|Apache ServiceMix :: Bundles :: bcel (5.2.0.4)
    8|Active     |    1|Apache ServiceMix :: Bundles :: poi (3.11.0)
    9|Active     |    1|Apache ServiceMix :: Bundles :: xalan (2.7.1.4)
   10|Active     |    1|Apache ServiceMix :: Bundles :: xercesImpl (2.9.1.4)
   11|Active     |    1|Apache ServiceMix :: Bundles :: xmlresolver (1.2.0.5)
   12|Active     |    1|Apache ServiceMix :: Bundles :: xmlsec (1.4.3.3)
   13|Active     |    1|Apache Sling OSGi LogService Implementation (1.0.4)
   14|Active     |    1|OPS4J Pax Logging - API (1.8.2)
   15|Active     |    1|OPS4J Pax Logging - Log4j v2 (1.8.2)
   16|Active     |    1|Apache XML Security for Java (2.0.1)
Comment 3 Bob Paulin 2015-04-26 15:41:19 UTC
So just as a quick experiment I did get the service mix 3.11 bundle running but it did take some toying around:

In the config I had to add:
org.osgi.framework.system.packages.extra=org.w3c.dom,org.w3c.dom.html,org.w3c.dom.traversal,org.w3c.dom.ranges,org.w3c.dom.views

This exposes the JRE classes to the osgi container.


Also below is the log out of the bundles that I had in play to get it to spin up.  The bundles I added are 1, 7-12,16.  
START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (4.6.1)
    1|Active     |    1|Apache Commons Codec (1.9.0)
    2|Active     |    1|Apache Felix Bundle Repository (2.0.2)
    3|Active     |    1|Apache Felix Configuration Admin Service (1.8.2)
    4|Active     |    1|Apache Felix Gogo Command (0.14.0)
    5|Active     |    1|Apache Felix Gogo Runtime (0.12.1)
    6|Active     |    1|Apache Felix Gogo Shell (0.10.0)
    7|Active     |    1|Apache ServiceMix :: Bundles :: bcel (5.2.0.4)
    8|Active     |    1|Apache ServiceMix :: Bundles :: poi (3.11.0)
    9|Active     |    1|Apache ServiceMix :: Bundles :: xalan (2.7.1.4)
   10|Active     |    1|Apache ServiceMix :: Bundles :: xercesImpl (2.9.1.4)
   11|Active     |    1|Apache ServiceMix :: Bundles :: xmlresolver (1.2.0.5)
   12|Active     |    1|Apache ServiceMix :: Bundles :: xmlsec (1.4.3.3)
   13|Active     |    1|Apache Sling OSGi LogService Implementation (1.0.4)
   14|Active     |    1|OPS4J Pax Logging - API (1.8.2)
   15|Active     |    1|OPS4J Pax Logging - Log4j v2 (1.8.2)
   16|Active     |    1|Apache XML Security for Java (2.0.1)
Comment 4 Bob Paulin 2015-05-14 22:10:06 UTC
Created attachment 32736 [details]
PAX-EXAM Patch
Comment 5 Bob Paulin 2015-05-14 22:17:26 UTC
Attached is a Patch that sets up a PAX-Exam test for the POI bundle project.  The setup is based on the servicemix project work to configure the optional imports but I tried to keep the exports as minimal as possible.  The tests pass for 3.11 but not 3.12-beta2 because it appears that the org.etsi.uri.x01903.v14 and org.etsi.uri.x01903.v14.impl packages have been removed from the poi-ooxml-schemas jar at 3.12-beta2.  Either these packages need to be removed from the poi jar or they need to be added back into the poi-ooxml-schemas jar.
Comment 6 Dominik Stadler 2015-08-20 19:27:54 UTC
*** Bug 53866 has been marked as a duplicate of this bug. ***
Comment 7 Andreas Beeker 2016-10-08 17:20:05 UTC
Created attachment 34336 [details]
ServiceMix patch

This is a preliminary patch for Apache ServiceMix (i.e not for POI itself), which still needs to be tweaked when POI 3.16 comes out, which contains the fix for #60226

The tweak might contain additions like ...
- org.apache.xml.security.signature;resolution:=optional,


fyi - this is related to the SO issue [1]

[1] http://stackoverflow.com/questions/38791416/apache-poi-felix-xslf-table-is-empty