You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Freeman Fang (JIRA)" <ji...@apache.org> on 2019/08/14 16:27:00 UTC

[jira] [Assigned] (KARAF-6380) Karaf does not pass configs with dashes to ManagedService

     [ https://issues.apache.org/jira/browse/KARAF-6380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang reassigned KARAF-6380:
-----------------------------------

    Assignee: Freeman Fang

> Karaf does not pass configs with dashes to ManagedService
> ---------------------------------------------------------
>
>                 Key: KARAF-6380
>                 URL: https://issues.apache.org/jira/browse/KARAF-6380
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 4.2.6
>            Reporter: Kamil
>            Assignee: Freeman Fang
>            Priority: Major
>
> I have a bundle with this code in activator:
>  
> {code:java}
>   @Override
>   public final void start(final BundleContext bundleContext) throws InterruptedException {
> // final String pid = "foo.bar.e35a73c8-f720-4652-83bb-2b9ed79ea51e"; //does not work!
>     final String pid = "foo.bar.e35a73c8f720465283bb2b9ed79ea51e";
>     ServiceRegistration<ManagedService> serviceReg = bundleContext.registerService(ManagedService.class, new ConfigUpdater(), new Hashtable<>(singletonMap(Constants.SERVICE_PID, pid)));
> }
> {code}
> where:
> {code:java}
>   private final class ConfigUpdater implements ManagedService {
>       @Override
>       public void updated(final Dictionary<String, ?> config) throws ConfigurationException {
>         if (config == null) {
>           System.out.println("The config is null!");
>           return;
>         }
>       }
>   }
> {code}
> and two files in $KARAF_HOME/etc:
>  * foo.bar.e35a73c8-f720-4652-83bb-2b9ed79ea51e.cfg
>  * foo.bar.e35a73c8f720465283bb2b9ed79ea51e.cfg
> the first pid gives null as a config, while the second works



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)