Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy are uses constraints violated when both chains end in the same bundle?
    primarykey
    data
    text
    <p>I have four bundles, each containing only a manifest. The bundles are</p> <ul> <li><code>app</code> which imports <code>com.example.foo.fragment</code> and <code>com.example.bar</code></li> <li><code>foo</code> which exports <code>com.example.foo;uses:=com.example.foo.cfg</code></li> <li><code>foo.fragment</code> which is a fragment attached to <code>foo</code> that exports <code>com.example.foo.fragment</code> and <code>com.example.foo.fragment.cfg;uses:=com.example.foo.fragment</code></li> <li><code>bar</code> which exports <code>com.example.bar</code> and imports <code>com.example.foo</code></li> </ul> <p><strong>Bundle-level dependency graph</strong>:</p> <pre><code>app -&gt; bar | | | v | foo | | v v foo.fragment </code></pre> <p>When I install these bundles all at once in JBoss AS 7.2, they work just fine. But if I install the <code>app</code> bundle <em>after</em> the others, either for the first time or after successfully starting and then uninstalling it, the following uses constraint violation occurs:</p> <pre><code>Caused by: org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource com.example.app [HostBundleRevision[com.example.app:0.0. 0]] because it is exposed to package 'com.example.foo.fragment' from resources com.example.foo [HostBundleRevision[com.example.foo:0.0.0]] and com.example.foo [HostBund leRevision[com.example.foo:0.0.0]] via two dependency chains. Chain 1: com.example.app [HostBundleRevision[com.example.app:0.0.0]] import: null | export: osgi.wiring.package=com.example.foo.fragment com.example.foo [HostBundleRevision[com.example.foo:0.0.0]] Chain 2: com.example.app [HostBundleRevision[com.example.app:0.0.0]] import: null | export: osgi.wiring.package=com.example.bar; uses:=com.example.foo com.example.bar [HostBundleRevision[com.example.bar:0.0.0]] import: null | export: osgi.wiring.package=com.example.foo; uses:=com.example.foo.fragment export: osgi.wiring.package=com.example.foo.fragment com.example.foo [HostBundleRevision[com.example.foo:0.0.0]] at org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1142) at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:197) at org.jboss.osgi.resolver.felix.StatelessResolver.resolve(StatelessResolver.java:56) at org.jboss.osgi.framework.internal.ResolverImpl.resolveAndApply(ResolverImpl.java:137) at org.jboss.as.osgi.service.BundleLifecycleIntegration$BundleLifecycleImpl.activateDeferredPhase(BundleLifecycleIntegration.java:296) ... 31 more </code></pre> <p>The full manifests are:</p> <pre><code>app.jar/META-INF/MANIFEST.MF ---------------------------- Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: com.example.app Import-Package: com.example.foo.fragment,com.example.bar ---------------------------- foo.jar/META-INF/MANIFEST.MF ---------------------------- Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: com.example.foo Export-Package: com.example.foo;uses:="com.example.foo.cfg" ------------------------------------- foo.fragment.jar/META-INF/MANIFEST.MF ------------------------------------- Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: com.example.foo.fragment Fragment-Host: com.example.foo Export-Package: com.example.foo.fragment,com.example.foo.cfg;uses:="co m.example.foo.fragment" ---------------------------- bar.jar/META-INF/MANIFEST.MF ---------------------------- Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: com.example.bar Export-Package: com.example.bar;uses:="com.example.foo" Import-Package: com.example.foo </code></pre> <p>I have not been able to reproduce the above error in standalone Apache Felix 4.2.1.</p> <p>What is the cause of this behaviour? If I delete the <code>Fragment-Host: com.example.foo</code> row from the <code>foo.fragment</code> manifest, I can reinstall <code>app</code> just fine without errors. Is this a bug in JBoss AS 7.2?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload