Yes, I have observed the same behavior. I assumed I was doing something wrong 
and removed the config from the feature.xml.

Erwin

> On Aug 30, 2016, at 11:39, AndyPhillips404 <[email protected]> wrote:
> 
> I have noticed in Karaf 4.0.5 and .6 that implementing configurations for
> factoryConfigurations in the features resolver doesn't appear to work as
> expected anymore. 
> 
> When you add a config to the feature xml, that is a factoryConfiguration, it
> creates two instances.   I think this is because the first one creates the
> configuration with the configuration admin, but then also places the file in
> the config directory which creates a second PID.   
> 
> Here is what i put in my features:
>        <config name="com.awplab.core.mongodb.admin.log-hdscores">
>            com.awplab.core.mongodb.admin.log.database = hdscores
>            com.awplab.core.mongodb.admin.log.collection = log
>        </config>
> 
> then here is what is show in the configuration list:
> 
> Pid:           
> com.awplab.core.mongodb.admin.log.7757ab66-17db-49ff-93c7-14024da29040
> FactoryPid:     com.awplab.core.mongodb.admin.log
> BundleLocation: null
> Properties:
>   com.awplab.core.mongodb.admin.log.collection = log
>   com.awplab.core.mongodb.admin.log.database = hdscores
>   org.apache.karaf.features.configKey =
> com.awplab.core.mongodb.admin.log-hdscores
>   service.factoryPid = com.awplab.core.mongodb.admin.log
>   service.pid =
> com.awplab.core.mongodb.admin.log.7757ab66-17db-49ff-93c7-14024da29040
> ----------------------------------------------------------------
> Pid:           
> com.awplab.core.mongodb.admin.log.7e2a6318-a639-4ce0-ad00-2eb0e7d7a6a7
> FactoryPid:     com.awplab.core.mongodb.admin.log
> BundleLocation: mvn:com.awplab.core/mongodb.admin/1.0.0-SNAPSHOT
> Properties:
>   com.awplab.core.mongodb.admin.log.collection = log
>   com.awplab.core.mongodb.admin.log.database = hdscores
>   felix.fileinstall.filename =
> file:/opt/karaf/etc/com.awplab.core.mongodb.admin.log-hdscores.cfg
>   service.factoryPid = com.awplab.core.mongodb.admin.log
>   service.pid =
> com.awplab.core.mongodb.admin.log.7e2a6318-a639-4ce0-ad00-2eb0e7d7a6a7
> 
> 
> Also, i have confirmed that there are "two" instances running (i use ipojo):
> Name                                                                     |
> Bundle Id | State
> ----------------------------------------------------------------------------------------------------
> com.awplab.core.mongodb.admin.log.7e2a6318-a639-4ce0-ad00-2eb0e7d7a6a7   |
> 92        | VALID
> com.awplab.core.mongodb.admin.log.7757ab66-17db-49ff-93c7-14024da29040   |
> 92        | VALID
> 
> This code used to work (i'm not sure which version) but in the last few
> versions, i've noticed this broke.  Am i doing something wrong?  If not, i
> can look at the code but i wanted to see if anyone has any thoughts if i am
> doing something obviously wrong....
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/Karaf-4-0-6-tp4047757.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to