You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by "J. Brebec" <je...@gmail.com> on 2017/09/25 15:03:11 UTC

Duplicate Configuration when installing a feature

Hi,

I am using Karaf 4.1.2 and a simple feature like :

<feature name="my-feature">
  <config name="my.pid-myfactorypid">
     myproperty = xxx
  </config>
</feature>

when this feature is installed, I can see with the "config:list" command that this configuration is deployed two times, one with a "org.apache.karaf.features.configKey" property, and the second one with "felix.fileinstall.filename".

as this configuration is used with a ManagedServiceFactory, the components is instanciated two times instead of one.

Is it a known issue ? To me, it's related to FeatureConfigInstaller.updateStore() with doesn't add explicitly a "felix.fileinstall.filename" property..

Regards,
Jérémie



Re: Duplicate Configuration when installing a feature

Posted by "J. Brebec" <je...@gmail.com>.
In fact, this commit doesn't always work : on a cold start, if the file is present on "etc", fileinstall can discover the configuration file exactly when the FeatureService create a Configuration object. In this case, two configurations are registered.

In my case, the configuration file is always present on etc because of the karaf-maven-plugin, and this issue appears randomly.


On 2017-09-26 09:16, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote: 
> I cherry-pick the commit on karaf-4.1.x branch and testing both locally and on 
> Jenkins.
> 
> Regards
> JB
> 
> On 09/26/2017 08:31 AM, J. Brebec wrote:
> > I haven't found a ticket on jira about this issue.. however, backporting the commit [1] into the branch karaf-4.1 fixes it for me.
> > 
> > Regards
> > 
> > [1] https://github.com/apache/karaf/commit/d1ce154d27c8416911deec29f04594ff805d90df
> > 
> > 
> > 
> > On 2017-09-25 18:23, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> >> Hi,
> >>
> >> yes, it's due to the - in the config name. The workaround is to use
> >> <configfile/> instead.
> >>
> >> We already have a Jira about that, let me find it.
> >>
> >> Regards
> >> JB
> >>
> >> On 09/25/2017 05:03 PM, J. Brebec wrote:
> >>> Hi,
> >>>
> >>> I am using Karaf 4.1.2 and a simple feature like :
> >>>
> >>> <feature name="my-feature">
> >>>     <config name="my.pid-myfactorypid">
> >>>        myproperty = xxx
> >>>     </config>
> >>> </feature>
> >>>
> >>> when this feature is installed, I can see with the "config:list" command that this configuration is deployed two times, one with a "org.apache.karaf.features.configKey" property, and the second one with "felix.fileinstall.filename".
> >>>
> >>> as this configuration is used with a ManagedServiceFactory, the components is instanciated two times instead of one.
> >>>
> >>> Is it a known issue ? To me, it's related to FeatureConfigInstaller.updateStore() with doesn't add explicitly a "felix.fileinstall.filename" property..
> >>>
> >>> Regards,
> >>> Jérémie
> >>>
> >>>
> >>
> >> -- 
> >> Jean-Baptiste Onofré
> >> jbonofre@apache.org
> >> http://blog.nanthrax.net
> >> Talend - http://www.talend.com
> >>
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
> 

Re: Duplicate Configuration when installing a feature

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
I cherry-pick the commit on karaf-4.1.x branch and testing both locally and on 
Jenkins.

Regards
JB

On 09/26/2017 08:31 AM, J. Brebec wrote:
> I haven't found a ticket on jira about this issue.. however, backporting the commit [1] into the branch karaf-4.1 fixes it for me.
> 
> Regards
> 
> [1] https://github.com/apache/karaf/commit/d1ce154d27c8416911deec29f04594ff805d90df
> 
> 
> 
> On 2017-09-25 18:23, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>> Hi,
>>
>> yes, it's due to the - in the config name. The workaround is to use
>> <configfile/> instead.
>>
>> We already have a Jira about that, let me find it.
>>
>> Regards
>> JB
>>
>> On 09/25/2017 05:03 PM, J. Brebec wrote:
>>> Hi,
>>>
>>> I am using Karaf 4.1.2 and a simple feature like :
>>>
>>> <feature name="my-feature">
>>>     <config name="my.pid-myfactorypid">
>>>        myproperty = xxx
>>>     </config>
>>> </feature>
>>>
>>> when this feature is installed, I can see with the "config:list" command that this configuration is deployed two times, one with a "org.apache.karaf.features.configKey" property, and the second one with "felix.fileinstall.filename".
>>>
>>> as this configuration is used with a ManagedServiceFactory, the components is instanciated two times instead of one.
>>>
>>> Is it a known issue ? To me, it's related to FeatureConfigInstaller.updateStore() with doesn't add explicitly a "felix.fileinstall.filename" property..
>>>
>>> Regards,
>>> Jérémie
>>>
>>>
>>
>> -- 
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>

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

Re: Duplicate Configuration when installing a feature

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Oky. Let me check.

Regards
JB

On Sep 26, 2017, 08:31, at 08:31, "J. Brebec" <je...@gmail.com> wrote:
>I haven't found a ticket on jira about this issue.. however,
>backporting the commit [1] into the branch karaf-4.1 fixes it for me.
>
>Regards
>
>[1]
>https://github.com/apache/karaf/commit/d1ce154d27c8416911deec29f04594ff805d90df
>
>
>
>On 2017-09-25 18:23, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote: 
>> Hi,
>> 
>> yes, it's due to the - in the config name. The workaround is to use 
>> <configfile/> instead.
>> 
>> We already have a Jira about that, let me find it.
>> 
>> Regards
>> JB
>> 
>> On 09/25/2017 05:03 PM, J. Brebec wrote:
>> > Hi,
>> > 
>> > I am using Karaf 4.1.2 and a simple feature like :
>> > 
>> > <feature name="my-feature">
>> >    <config name="my.pid-myfactorypid">
>> >       myproperty = xxx
>> >    </config>
>> > </feature>
>> > 
>> > when this feature is installed, I can see with the "config:list"
>command that this configuration is deployed two times, one with a
>"org.apache.karaf.features.configKey" property, and the second one with
>"felix.fileinstall.filename".
>> > 
>> > as this configuration is used with a ManagedServiceFactory, the
>components is instanciated two times instead of one.
>> > 
>> > Is it a known issue ? To me, it's related to
>FeatureConfigInstaller.updateStore() with doesn't add explicitly a
>"felix.fileinstall.filename" property..
>> > 
>> > Regards,
>> > Jérémie
>> > 
>> > 
>> 
>> -- 
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>> 

Re: Duplicate Configuration when installing a feature

Posted by "J. Brebec" <je...@gmail.com>.
I haven't found a ticket on jira about this issue.. however, backporting the commit [1] into the branch karaf-4.1 fixes it for me.

Regards

[1] https://github.com/apache/karaf/commit/d1ce154d27c8416911deec29f04594ff805d90df



On 2017-09-25 18:23, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote: 
> Hi,
> 
> yes, it's due to the - in the config name. The workaround is to use 
> <configfile/> instead.
> 
> We already have a Jira about that, let me find it.
> 
> Regards
> JB
> 
> On 09/25/2017 05:03 PM, J. Brebec wrote:
> > Hi,
> > 
> > I am using Karaf 4.1.2 and a simple feature like :
> > 
> > <feature name="my-feature">
> >    <config name="my.pid-myfactorypid">
> >       myproperty = xxx
> >    </config>
> > </feature>
> > 
> > when this feature is installed, I can see with the "config:list" command that this configuration is deployed two times, one with a "org.apache.karaf.features.configKey" property, and the second one with "felix.fileinstall.filename".
> > 
> > as this configuration is used with a ManagedServiceFactory, the components is instanciated two times instead of one.
> > 
> > Is it a known issue ? To me, it's related to FeatureConfigInstaller.updateStore() with doesn't add explicitly a "felix.fileinstall.filename" property..
> > 
> > Regards,
> > Jérémie
> > 
> > 
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
> 

Re: Duplicate Configuration when installing a feature

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

yes, it's due to the - in the config name. The workaround is to use 
<configfile/> instead.

We already have a Jira about that, let me find it.

Regards
JB

On 09/25/2017 05:03 PM, J. Brebec wrote:
> Hi,
> 
> I am using Karaf 4.1.2 and a simple feature like :
> 
> <feature name="my-feature">
>    <config name="my.pid-myfactorypid">
>       myproperty = xxx
>    </config>
> </feature>
> 
> when this feature is installed, I can see with the "config:list" command that this configuration is deployed two times, one with a "org.apache.karaf.features.configKey" property, and the second one with "felix.fileinstall.filename".
> 
> as this configuration is used with a ManagedServiceFactory, the components is instanciated two times instead of one.
> 
> Is it a known issue ? To me, it's related to FeatureConfigInstaller.updateStore() with doesn't add explicitly a "felix.fileinstall.filename" property..
> 
> Regards,
> Jérémie
> 
> 

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