[ 
https://issues.apache.org/jira/browse/ARIES-1416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14903853#comment-14903853
 ] 

John Ross edited comment on ARIES-1416 at 9/23/15 11:12 AM:
------------------------------------------------------------

A second manifestation of this issue occurs when a resource will become part of 
the shared content of an installing feature whose archive contains a child 
subsystem with a Preferred-Provider header listing that resource. This issue 
can be reproduced with the following scenario.

Bundle-SymbolicName: bundle.a.jar
Require-Capability: b

Bundle-SymbolicName: bundle.b.jar
Provide-Capability: b

Subsystem-SymbolicName: application.a.esa
Subsystem-Content: bundle.a.jar
Subsystem-Type: osgi.subsystem.application;provision-policy:=rejectDependencies
Preferred-Provider: bundle.b.jar
(include bundle.b.jar in the archive but not as content)

Subsystem-SymbolicName: feature.a.esa
Subsystem-Content: bundle.b.jar, application.a.esa
Subsystem-Type: osgi.subsystem.feature

Subsystem-SymbolicName: feature.b.esa
Subsystem-Content: bundle.b.jar, application.a.esa
Subsystem-Type: osgi.subsystem.feature

(1) Install feature A.
(2) Install feature B.

When feature B is installed, and thus application A, preferred provider bundle 
B from the system repository is considered invalid because shared content 
bundle B has not yet become a constituent of parent subsystem feature B. 
Consequently, preferred provider bundle B from the local repository is selected 
resulting in the exception as described in the previous comment. 
SubsystemResourceInstallerInstallOrder.patch from ARIES-1357 takes the approach 
of "installing" shared content before installable dependencies which solves the 
issue and seems to be the right way to go.

Note that this issue can also be reproduced by placing bundle B in a repository 
service rather than in the archives of feature A, feature B, and application A.


was (Author: [email protected]):
A second manifestation of this issue occurs when a resource will become part of 
the shared content of an installing feature whose archive contains a child 
subsystem with a Preferred-Provider header listing that resource. This issue 
can be reproduced with the following scenario.

Bundle-SymbolicName: bundle.a.jar
Require-Capability: b

Bundle-SymbolicName: bundle.b.jar
Provide-Capability: b

Subsystem-SymbolicName: application.a.esa
Subsystem-Content: bundle.a.jar
Subsystem-Type: osgi.subsystem.application;provision-policy:=rejectDependencies
Preferred-Provider: bundle.b.jar
(include bundle.b.jar in the archive but not as content)

Subsystem-SymbolicName: feature.a.esa
Subsystem-Content: bundle.b.jar, application.a.esa
Subsystem-Type: osgi.subsystem.feature

Subsystem-SymbolicName: feature.b.esa
Subsystem-Content: bundle.b.jar, application.a.esa
Subsystem-Type: osgi.subsystem.feature

(1) Install feature A.
(2) Install feature B.

When feature B is installed, and thus application A, preferred provider bundle 
B from the system repository is considered invalid because shared content 
bundle B has not yet become a constituent of parent subsystem feature B. 
Consequently, preferred provider bundle B from the local repository is selected 
resulting in the exception as described in the previous comment. 
SubsystemResourceInstallerInstallOrder.patch from ARIES-1357 takes the approach 
of "installing" shared content before installable dependencies which solves the 
issue and seems to be the right way to go.

> BundleException "bundle is already installed" when the Preferred-Provider 
> subsystem header points to a bundle.
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-1416
>                 URL: https://issues.apache.org/jira/browse/ARIES-1416
>             Project: Aries
>          Issue Type: Bug
>          Components: Subsystem
>            Reporter: John Ross
>            Assignee: John Ross
>
> When using the Preferred-Provider header that specifies a bundle, an 
> exception similar to the following is received:
> org.osgi.framework.BundleException: A bundle is already installed with the 
> name "bundle.c.jar" and version "0.0.0"
>       at 
> org.eclipse.osgi.container.ModuleContainer.install(ModuleContainer.java:254)
>       at org.eclipse.osgi.storage.Storage.install(Storage.java:513)
>       at 
> org.eclipse.osgi.internal.framework.BundleContextImpl.installBundle(BundleContextImpl.java:146)
>       at 
> org.eclipse.equinox.internal.region.BundleIdBasedRegion.installBundle0(BundleIdBasedRegion.java:117)
>       at 
> org.eclipse.equinox.internal.region.BundleIdBasedRegion.installBundleAtLocation(BundleIdBasedRegion.java:97)
>       at 
> org.apache.aries.subsystem.core.internal.BundleResourceInstaller.installBundle(BundleResourceInstaller.java:197)
>       at 
> org.apache.aries.subsystem.core.internal.BundleResourceInstaller.install(BundleResourceInstaller.java:182)
>       at 
> org.apache.aries.subsystem.core.internal.SubsystemResourceInstaller.installAriesSubsystem(SubsystemResourceInstaller.java:98)
>       at 
> org.apache.aries.subsystem.core.internal.SubsystemResourceInstaller.installSubsystemResource(SubsystemResourceInstaller.java:159)
>       at 
> org.apache.aries.subsystem.core.internal.SubsystemResourceInstaller.installRawSubsystemResource(SubsystemResourceInstaller.java:130)
>       at 
> org.apache.aries.subsystem.core.internal.SubsystemResourceInstaller.install(SubsystemResourceInstaller.java:38)
>       at 
> org.apache.aries.subsystem.core.internal.SubsystemResourceInstaller.installAriesSubsystem(SubsystemResourceInstaller.java:113)
>       at 
> org.apache.aries.subsystem.core.internal.SubsystemResourceInstaller.install(SubsystemResourceInstaller.java:36)
>       at 
> org.apache.aries.subsystem.core.internal.InstallAction.run(InstallAction.java:77)
>       at 
> org.apache.aries.subsystem.core.internal.InstallAction.run(InstallAction.java:30)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at 
> org.apache.aries.subsystem.core.internal.BasicSubsystem.install(BasicSubsystem.java:646)
>       at 
> org.apache.aries.subsystem.core.internal.BasicSubsystem.install(BasicSubsystem.java:690)
>       at 
> org.apache.aries.subsystem.core.internal.BasicSubsystem.install(BasicSubsystem.java:278)
>       at 
> org.apache.aries.subsystem.core.internal.BasicSubsystem.install(BasicSubsystem.java:65)
> ...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to