You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Gareth <ga...@gmail.com> on 2013/06/11 19:42:24 UTC

Uninstalling Declarative Services Bundles Which Require Configuration

Hello,

I am seeing behaviour in karaf which I did not expect.

I uninstalled a bundle which used declarative services...and reinstalled it
from a different location (old location - maven repository in nexus, new
location - local file system).

When I ran config:list for the pid after doing this, it still showed that
the config was bound to the old bundle, even though it was uninstalled
(which of course meant the new bundle could not be activated using
declarative services). This behaviour persisted even after a restart of
karaf.

To fix I had to remove and re-add the configuration. I shouldn't need to do
this, should I? This is a bug? I am using karaf 2.3.1 with equinox.

thanks in advance,
Gareth




--
View this message in context: http://karaf.922171.n3.nabble.com/Uninstalling-Declarative-Services-Bundles-Which-Require-Configuration-tp4029022.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Uninstalling Declarative Services Bundles Which Require Configuration

Posted by David Jencks <da...@yahoo.com>.
I looked at some specs a little more and found this in enterprise 5.0.0 Config Admin 104.4.2:
----
	• Dynamic Binding

Dynamic binding is available for backward compatibility with earlier versions. It is recommended that management agents explicitly set the location to a ? (a multi-location) to allow multiple bundles to share PIDs and not use the dynamic binding facility. If a management agent uses ?, it must at least have ConfigurationPermission[ ?,CONFIGURE ] when security is on, it is also possible to use ConfigurationPermission[ ?*,CONFIGURE ] to not limit the management agent. See Regions on page 63 for some examples of using the locations in isolation scenarios.

A null location parameter can be used to create Configuration objects that are not yet bound. In this case, the Configuration becomes bound to a specific location the first time that it is compared to a Bundle’s location. If a bundle becomes dynamically bound to a Configuration then a CM_LOCATION_CHANGED event must be dispatched.

When this dynamically bound Bundle is subsequently uninstalled, configurations that are bound to this bundle must be released. That means that for such Configuration object’s the bundle location must be set to null again so it can be bound again to another bundle. 

----
The last paragraph indicates to me that it's CA's responsibility to unset the location when the bundle is uninstalled, not DS's responsibility to track whether or not it set the location.
Alternatively karat might try creating configurations with a multi-location of "?" although I don't know if felix ca supports this very well yet.  Felix DS does in trunk but not yet in a released version.  If I read the spec correctly the mulit-location is preferred but I would think that would effectively remove any binding of pids to bundles.

thanks
david jencks

On Jun 22, 2013, at 12:26 PM, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:

> Agree with David.
> 
> I take the Jira to deal with Felix DS.
> 
> Regards
> JB
> 
> On 06/22/2013 08:26 PM, David Jencks wrote:
>> The problem is in felix DS and possibly lack of specification.  If DS set the configuration location by requesting the config for a DS component, then DS should, I think, reset it to null when the service is uninstalled.  If something else set the configuration location then DS should leave it alone.
>> 
>> thanks
>> david jencks
>> 
>> 
>> On Jun 22, 2013, at 11:11 AM, Gareth <ga...@gmail.com> wrote:
>> 
>>> OK, I assume it is a defect then. JIRA added:
>>> 
>>> https://issues.apache.org/jira/browse/KARAF-2367
>>> 
>>> thanks,
>>> Gareth
>>> 
>>> 
>>> 
>>> --
>>> View this message in context: http://karaf.922171.n3.nabble.com/Uninstalling-Declarative-Services-Bundles-Which-Require-Configuration-tp4029022p4029091.html
>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com


Re: Uninstalling Declarative Services Bundles Which Require Configuration

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Agree with David.

I take the Jira to deal with Felix DS.

Regards
JB

On 06/22/2013 08:26 PM, David Jencks wrote:
> The problem is in felix DS and possibly lack of specification.  If DS set the configuration location by requesting the config for a DS component, then DS should, I think, reset it to null when the service is uninstalled.  If something else set the configuration location then DS should leave it alone.
>
> thanks
> david jencks
>
>
> On Jun 22, 2013, at 11:11 AM, Gareth <ga...@gmail.com> wrote:
>
>> OK, I assume it is a defect then. JIRA added:
>>
>> https://issues.apache.org/jira/browse/KARAF-2367
>>
>> thanks,
>> Gareth
>>
>>
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.com/Uninstalling-Declarative-Services-Bundles-Which-Require-Configuration-tp4029022p4029091.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Uninstalling Declarative Services Bundles Which Require Configuration

Posted by David Jencks <da...@yahoo.com>.
The problem is in felix DS and possibly lack of specification.  If DS set the configuration location by requesting the config for a DS component, then DS should, I think, reset it to null when the service is uninstalled.  If something else set the configuration location then DS should leave it alone.

thanks
david jencks


On Jun 22, 2013, at 11:11 AM, Gareth <ga...@gmail.com> wrote:

> OK, I assume it is a defect then. JIRA added:
> 
> https://issues.apache.org/jira/browse/KARAF-2367
> 
> thanks,
> Gareth
> 
> 
> 
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Uninstalling-Declarative-Services-Bundles-Which-Require-Configuration-tp4029022p4029091.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Uninstalling Declarative Services Bundles Which Require Configuration

Posted by Gareth <ga...@gmail.com>.
OK, I assume it is a defect then. JIRA added:

https://issues.apache.org/jira/browse/KARAF-2367

thanks,
Gareth



--
View this message in context: http://karaf.922171.n3.nabble.com/Uninstalling-Declarative-Services-Bundles-Which-Require-Configuration-tp4029022p4029091.html
Sent from the Karaf - User mailing list archive at Nabble.com.