On Nov 11, 2009, at 8:28 AM, Dave wrote:
I know that Atlassian has converted Shindig to OSGi bundles for use in JIRA 4.0, perhaps they could offer some advice here or perhaps even some code ;-)
Our approach was a little different. Rather than converting Shindig's JARs to bundles, we wrapped them all up in our own bundle that exports a simplified adapter API/SPI. We used a mechanism that is specific to the Atlassian plugin framework to register the servlets. Implementations of the SPI are OSGi services that we use via Spring DM, and the API implementations within our bundle are also published as OSGi services.
Some of the dependencies are packed into the JAR, but some are imported as normal bundles. The only one that gave us trouble was Xerces, and only on the IBM JDK. The DOMImplementationProvider class was trying to load the Xerces DOMImplementationImpl using the wrong package name, so we just wrote our own version of the ParseModule that simply uses the Xerces version always (since we always bundle it with our apps). Actually, that seems to still be the case on trunk, so I'll file an issue. https://issues.apache.org/jira/browse/SHINDIG-1224 The other gotcha to look out for there is that the IBM JDK bundles Xerces with the system classes, without transforming the package names like Sun does, so even if you bundle Xerces with your app, it will use the system version.
I imagine there would be issues with XML parsing on the IBM JDK even without OSGi being involved, so maybe you've already run into this?
-- Tim