You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by "Guillaume Sauthier (OW2/GMail)" <gu...@gmail.com> on 2013/01/22 11:44:42 UTC

Cannot install the same bundle in 2 differents application subsystems

Hi

I try to install the same bundle (same location) into 2 different
pre-existing application subsystems.
That bundle is not defined in the Subsystem-Content, in other word, it's
not part of the original Subsystem definition (in both Subsystems).
I take the BundleContext of the app's region to perform the install action.
Eclipse spit the following BundleException for the 2nd Subsystem:

guillaume@shelbie$ constituent:install-bundle
file:///.../neutral-hello-consumer-0.0.1-SNAPSHOT.jar
Bundle agent: org.osgi.service.subsystem.region.context.3
[BundleException]: Bundle "neutral-hello-consumer" version "0.0.1.SNAPSHOT"
has already been installed from:
file:///.../neutral-hello-consumer-0.0.1-SNAPSHOT.jar

guillaume@shelbie$ $exception printstacktrace
org.osgi.framework.BundleException: Bundle "neutral-hello-consumer" version
"0.0.1.SNAPSHOT" has already been installed from:
file:///.../neutral-hello-consumer-0.0.1-SNAPSHOT.jar
at
org.eclipse.osgi.framework.internal.core.Framework.installWorker(Framework.java:873)
at
org.eclipse.osgi.framework.internal.core.Framework.installBundle(Framework.java:840)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.installBundle(BundleContextImpl.java:137)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.installBundle(BundleContextImpl.java:131)
at
com.peergreen.platform.commands.subsystem.internal.bundle.InstallBundleAction.__M_execute(InstallBundleAction.java:50)
at
com.peergreen.platform.commands.subsystem.internal.bundle.InstallBundleAction.execute(InstallBundleAction.java)
at
org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)
at
org.ow2.shelbie.core.internal.handler.CommandHandler.__M_execute(CommandHandler.java:166)
at
org.ow2.shelbie.core.internal.handler.CommandHandler.execute(CommandHandler.java)
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
at
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
at org.ow2.shelbie.core.console.JLineConsole.run(JLineConsole.java:149)
at java.lang.Thread.run(Thread.java:722)

I did read the spec, in particular the Explicit Bundle Resource section,
and nothing mentions that a Bundle cannot be installed twice in
**different** region.
The spec states that trying to install the same bundle in 2 subsystems part
of the **same** region is an error (I'm ok with that), but nothing about
the same bundle in different regions. So I thought that my use case was
allowed :)
It may be interesting to notice that if the bundle is part of the initial
Subsystem (defined in Subsystem-Content), that works great (location URLs
are probably different, that could explain why it works in that case).

So, am I reading the spec incorrectly and my use case is invalid, or did I
hit a missing feature/bug in aries subsystems ?

BTW I'm using latest Subsystems snapshot.

Thanks
--Guillaume

Cannot install the same bundle in 2 differents application subsystems

Posted by "Guillaume Sauthier (OW2)" <gu...@ow2.org>.
Ok, I was expecting the real identifier to be the bsn+version couple, not
the location URL.
I did not set the property you mention, so I guess I have the default value.

I can confirm that the same bundle (bsn+version) included in each subsystem
works. The location URL is probable different.

Thanks for the explanation.
--G


2013/1/22 David Bosschaert <david.bosschaert@gmail.com <javascript:_e({},
'cvml', 'david.bosschaert@gmail.com');>>

> Hi Guillaume,
>
> If I'm not mistaken then you *can* install the same bundle (same bsn and
> same version) more than once as long as they are in different regions, but
> the bundle location must still be different in all cases.
>
> Also the org.osgi.framework.bsnversion launch property should be set to
> 'managed' or not set at all since that is the default.
>
> Best regards,
>
> David
>
>
> On 22 January 2013 10:44, Guillaume Sauthier (OW2/GMail) <
> guillaume.ow2@gmail.com <javascript:_e({}, 'cvml',
> 'guillaume.ow2@gmail.com');>> wrote:
>
>> Hi
>>
>> I try to install the same bundle (same location) into 2 different
>> pre-existing application subsystems.
>> That bundle is not defined in the Subsystem-Content, in other word, it's
>> not part of the original Subsystem definition (in both Subsystems).
>> I take the BundleContext of the app's region to perform the install
>> action.
>> Eclipse spit the following BundleException for the 2nd Subsystem:
>>
>> guillaume@shelbie$ constituent:install-bundle
>> file:///.../neutral-hello-consumer-0.0.1-SNAPSHOT.jar
>> Bundle agent: org.osgi.service.subsystem.region.context.3
>> [BundleException]: Bundle "neutral-hello-consumer" version
>> "0.0.1.SNAPSHOT" has already been installed from:
>> file:///.../neutral-hello-consumer-0.0.1-SNAPSHOT.jar
>>
>> guillaume@shelbie$ $exception printstacktrace
>> org.osgi.framework.BundleException: Bundle "neutral-hello-consumer"
>> version "0.0.1.SNAPSHOT" has already been installed from:
>> file:///.../neutral-hello-consumer-0.0.1-SNAPSHOT.jar
>>  at
>> org.eclipse.osgi.framework.internal.core.Framework.installWorker(Framework.java:873)
>> at
>> org.eclipse.osgi.framework.internal.core.Framework.installBundle(Framework.java:840)
>>  at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.installBundle(BundleContextImpl.java:137)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.installBundle(BundleContextImpl.java:131)
>>  at
>> com.peergreen.platform.commands.subsystem.internal.bundle.InstallBundleAction.__M_execute(InstallBundleAction.java:50)
>> at
>> com.peergreen.platform.commands.subsystem.internal.bundle.InstallBundleAction.execute(InstallBundleAction.java)
>>  at
>> org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)
>> at
>> org.ow2.shelbie.core.internal.handler.CommandHandler.__M_execute(CommandHandler.java:166)
>>  at
>> org.ow2.shelbie.core.internal.handler.CommandHandler.execute(CommandHandler.java)
>> at
>> org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)
>>  at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
>> at
>> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
>>  at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
>> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
>>  at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
>> at
>> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
>>  at org.ow2.shelbie.core.console.JLineConsole.run(JLineConsole.java:149)
>> at java.lang.Thread.run(Thread.java:722)
>>
>> I did read the spec, in particular the Explicit Bundle Resource section,
>> and nothing mentions that a Bundle cannot be installed twice in
>> **different** region.
>> The spec states that trying to install the same bundle in 2 subsystems
>> part of the **same** region is an error (I'm ok with that), but nothing
>> about the same bundle in different regions. So I thought that my use case
>> was allowed :)
>> It may be interesting to notice that if the bundle is part of the initial
>> Subsystem (defined in Subsystem-Content), that works great (location URLs
>> are probably different, that could explain why it works in that case).
>>
>> So, am I reading the spec incorrectly and my use case is invalid, or did
>> I hit a missing feature/bug in aries subsystems ?
>>
>> BTW I'm using latest Subsystems snapshot.
>>
>> Thanks
>> --Guillaume
>>
>
>

Re: Cannot install the same bundle in 2 differents application subsystems

Posted by David Bosschaert <da...@gmail.com>.
Hi Guillaume,

If I'm not mistaken then you *can* install the same bundle (same bsn and
same version) more than once as long as they are in different regions, but
the bundle location must still be different in all cases.

Also the org.osgi.framework.bsnversion launch property should be set to
'managed' or not set at all since that is the default.

Best regards,

David


On 22 January 2013 10:44, Guillaume Sauthier (OW2/GMail) <
guillaume.ow2@gmail.com> wrote:

> Hi
>
> I try to install the same bundle (same location) into 2 different
> pre-existing application subsystems.
> That bundle is not defined in the Subsystem-Content, in other word, it's
> not part of the original Subsystem definition (in both Subsystems).
> I take the BundleContext of the app's region to perform the install action.
> Eclipse spit the following BundleException for the 2nd Subsystem:
>
> guillaume@shelbie$ constituent:install-bundle
> file:///.../neutral-hello-consumer-0.0.1-SNAPSHOT.jar
> Bundle agent: org.osgi.service.subsystem.region.context.3
> [BundleException]: Bundle "neutral-hello-consumer" version
> "0.0.1.SNAPSHOT" has already been installed from:
> file:///.../neutral-hello-consumer-0.0.1-SNAPSHOT.jar
>
> guillaume@shelbie$ $exception printstacktrace
> org.osgi.framework.BundleException: Bundle "neutral-hello-consumer"
> version "0.0.1.SNAPSHOT" has already been installed from:
> file:///.../neutral-hello-consumer-0.0.1-SNAPSHOT.jar
>  at
> org.eclipse.osgi.framework.internal.core.Framework.installWorker(Framework.java:873)
> at
> org.eclipse.osgi.framework.internal.core.Framework.installBundle(Framework.java:840)
>  at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.installBundle(BundleContextImpl.java:137)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.installBundle(BundleContextImpl.java:131)
>  at
> com.peergreen.platform.commands.subsystem.internal.bundle.InstallBundleAction.__M_execute(InstallBundleAction.java:50)
> at
> com.peergreen.platform.commands.subsystem.internal.bundle.InstallBundleAction.execute(InstallBundleAction.java)
>  at
> org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)
> at
> org.ow2.shelbie.core.internal.handler.CommandHandler.__M_execute(CommandHandler.java:166)
>  at
> org.ow2.shelbie.core.internal.handler.CommandHandler.execute(CommandHandler.java)
> at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)
>  at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
> at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
>  at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
>  at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
> at
> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
>  at org.ow2.shelbie.core.console.JLineConsole.run(JLineConsole.java:149)
> at java.lang.Thread.run(Thread.java:722)
>
> I did read the spec, in particular the Explicit Bundle Resource section,
> and nothing mentions that a Bundle cannot be installed twice in
> **different** region.
> The spec states that trying to install the same bundle in 2 subsystems
> part of the **same** region is an error (I'm ok with that), but nothing
> about the same bundle in different regions. So I thought that my use case
> was allowed :)
> It may be interesting to notice that if the bundle is part of the initial
> Subsystem (defined in Subsystem-Content), that works great (location URLs
> are probably different, that could explain why it works in that case).
>
> So, am I reading the spec incorrectly and my use case is invalid, or did I
> hit a missing feature/bug in aries subsystems ?
>
> BTW I'm using latest Subsystems snapshot.
>
> Thanks
> --Guillaume
>