OSGi provides access to system packages, but only java. * By default, this does not include other packages, such as: javax.net, javax.xml, com.sun
Therefore, you must specify any of these packages for the OSGi platform to export through the system package, which will make them available for other packages that import them.
To do this, you need to set the configuration property with the additional packages required by your packages, try setting it as a system property before starting the OSGi environment so that it picks up this property the first time it starts.
Assuming you are on OSGi 4.2, this property will be configured as follows:
org.osgi.framework.system.packages.extra=org.w3c.dom
For more details, you can check the Apache Felix Framework configuration properties , although this property is part of the OSGi specification and therefore should also be available in other implementations.
source share