簡単な実験 -
バンドル A は、そのクラス ローダー ( jaxb.. ) を介して使用できるように、いくつかの com.sun.xml.internal.bind クラスを必要とします。
パッケージを「org.osgi.framework.system.packages.extra」(felixに実装されている標準フレームワークパラメーター、 http://felix.apache.org/site/apache-felix-framework-configuration-properties.htmlで文書化されています)、バンドルにインポートします。
そうすることで、バンドルは解決されなくなります..
Unable to resolve 5.0: missing requirement [5.0] osgi.wiring.package; (osgi.wiring.package=com.sun.xml.internal.bind)
( 5 は jaxb を使用するバンドルです) 「com.sun.xml.internal.bind」に「org.osgi.framework.bootdelegation」を設定し、依存バンドルにインポートしないことは、文書化されているとおりに機能しました。
system.packages.extra がすべきことを誤解していますか? system.bundle からのインポートを解決できませんか? Import-Package ディレクティブの下部にある bnd を介してインポートで system.bundle を明示的に設定しようとしました
com.sun.xml.internal.bind;bundle-symbolic-name="system.bundle",\
*
その結果、
Unable to resolve 5.0: missing requirement [5.0] osgi.wiring.package; (&(osgi.wiring.package=com.sun.xml.internal.bind)(bundle-symbolic-name=system.bundle))
ps: これらを定義するために bnd と -runproperties を使用しています。私のbndrunファイルには次のものがあります:
-runproperties: osgi.console.enable.builtin=true,\
com.mycompany.manager.confDir=./etc,\
org.osgi.framework.system.packages.extra=com.sun.xml.internal.bind,\
org.osgi.service.http.port=8888
jaxb を必要とするバンドルは、次のインポートを定義します
Import-Package: com.sun.xml.internal.bind,\
*
bndrun エディターで依存関係を解決しようとすると、
Unable to resolve <<INITIAL>> ver=null: missing requirement (osgi.identity=com.mycompany.configuration.jaxb) [caused by: Unable to resolve com.mycompany.configuration.jaxb ver=0.0.0: missing requirement (osgi.wiring.package=com.sun.xml.internal.bind)]
org.osgi.service.resolver.ResolutionException: Unable to resolve <<INITIAL>> ver=null: missing requirement (osgi.identity=com.mycompany.configuration.jaxb) [caused by: Unable to resolve com.mycompany.configuration.jaxb ver=0.0.0: missing requirement (osgi.wiring.package=com.sun.xml.internal.bind)]
at org.apache.felix.resolver.Candidates.populateResource(Candidates.java:285)
at org.apache.felix.resolver.Candidates.populate(Candidates.java:153)
at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:148)
at biz.aQute.resolve.ResolveProcess.resolveRequired(ResolveProcess.java:34)
at org.bndtools.core.resolve.ResolveOperation.run(ResolveOperation.java:61)
at org.bndtools.core.resolve.ResolveJob.run(ResolveJob.java:43)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)