Hi all,
I am running into some issues with a 3rd party
library, and I want to be sure I am correctly understanding the situation. My
system is Equinox-based, and I am attempting to introduce a bundle for document
processing. That JAR needs to introduce support for character sets which are
not included in Java by default. The Charset class uses Java’s SPI
pattern (http://java.sun.com/developer/technicalArticles/javase/extensible/index.html)
to discover additional Charset implementations at runtime. That JAR has been
altered to provide an OSGi manifest, but its META-INF/services/ java.nio.charset.spi.CharsetProvider
file remains in its original location.
The issue is that the SPI mechanism fails completely under
OSGi/Equinox. When I look at the implementation in java.nio.charset.Charset, it
uses the System ClassLoader when trying to find the appropriate resources.
Clearly, that doesn’t bode well for interaction with OSGi bundles.
That leaves me with a couple questions:
1) Is the general incompatibility between OSGi/Equinox
bundles and SPI a known issue?
2) Is there a workaround I can use to get things working?
Thanks,
+ + + + + + + + + + + + + + + +
Michael Furtak
Charles River Analytics Inc.
617.491.3474 x534
www.cra.com