1

Inside ee.j2se-1.8 the package org.w3c.dom is included.

org.osgi.framework.system.packages = \
...
 org.w3c.dom,\
...

org.osgi.framework.bootdelegation = \
...
org.w3c.*,\
org.xml.*,\
....

The bundle xml-apis_1.4.1.20140905-131237.jar contains the same package org.w3c.dom, but with one important class more ... ElementTraversal.class more.

So here my questions...

How can I provide the missing class inside my Equinox OSGi runtime?

4

1 回答 1

2

You are suffering from the fact that people do not take packages seriously. We have a similar problem in the jta API. The version delivered by the VM is not identical to the version that is delivered as a special package.

The solution is to include the JAR with the extra packages on the class path where the framework resides. It looks like you're using bnd (good!) so this would look like:

-runpath: xml-apis__xml-apis;version="[1.4.1,2.0.0)"

If this had been a bundle with proper exports then you would have automatically gotten its exports as system packages. Looking at the packages in this bundle it seems all packages are already in the standard exports of the VM. However, if you have packages int his JAR that are not exported by the VM then you can add them as follows:

 -runsystempackages: javax.xml.foo
于 2015-10-26T10:00:49.867 回答