karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kamil (JIRA)" <j...@apache.org>
Subject [jira] [Created] (KARAF-6380) Karaf does not pass cofigs with dashes to ManagedService
Date Wed, 14 Aug 2019 15:58:00 GMT
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:

  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)));
  private final class ConfigUpdater implements ManagedService {
      public void updated(final Dictionary<String, ?> config) throws ConfigurationException
        if (config == null) {
          System.out.println("The config is null!");
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

View raw message