In general, you want to have your bundle provide some sort of "factory" service, from which you can create instances of your desired UPnP control point component.

Angelo does a good job of describing this in detail for ManagedServiceFactory. Another, similar approach, is to use iPOJO to define your component type and then instantiate as many instances as you want.

-> richard

Ronan Dunklau wrote:
Thank you for your help, and your clarification about osgi specs. I wanted to install the same bundle several times to create several instances of a UPnP control point, and it seemed that this would fit perfectly for this usage, "isolating" the different instances into separate bundles.

I'm looking for a replacement solution.

Thanks.

Ronan Dunklau

Le Thursday 22 May 2008 13:54:36 Stuart McCulloch, vous avez écrit :
2008/5/22 Ronan Dunklau <[EMAIL PROTECTED]>:
Hello.

I'm trying to install bundles through the method:
BundleContext.installBundle(String location, InputStream stream)
and i'm experiencing problems with it.


I receive an Exception :


org.osgi.framework.BundleException: Bundle symbolic name and version are
not
unique.
        at org.apache.felix.framework.Felix.createModule(Felix.java:3425)
        at
org.apache.felix.framework.Felix.createBundleInfo(Felix.java:3349)
        at
org.apache.felix.framework.Felix.installBundle(Felix.java:2315) at
org.apache.felix.framework.Felix.installBundle(Felix.java:2229) at
.....

The bundle i'm trying to install is already installed, but under another
name
than location.

Maybe i did not understand the usage of this method:  location is
supposed to
be a unique identifier for this bundle ? If this is the case, why do i
get this Exception ?

I took a look to the code of Felix, and it appears that it checks Bundle
Symbolic Name and Version to be unique ( as i could guess by the
exception message :) ). Why ?
yes, the location of each installed bundle should be unique
- see the core spec, section 4.3.3 page 82 - and that if you
try to install a bundle with an existing location then you will
get back the already installed bundle for that location.

however, note the reference to bundle validity:

   "A bundle must be valid before it is installed, otherwise
    the install must fail. The validity of a bundle is discussed
    in Bundle Validity on page 64."

and one of the validity errors listed on page 64 is:

   "Installing a bundle that has the same symbolic
    name and version as an already installed bundle."

otherwise you would end up with the same bundle installed
in two locations, hence these additional validity checks

HTH

Thank you in advance for your help.

Ronan Dunklau

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to