Kamil created KARAF-6380:
----------------------------

             Summary: Karaf does not pass cofigs 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


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.e35a73c8f720465283bb2b9ed79ea51e";
//    final String pid = "foo.bar.e35a73c8-f720-4652-83bb-2b9ed79ea51e"; //does 
not work!
    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)

Reply via email to