Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-7255

KARAF JsonInstaller throw error on Null dictionary configuration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.3.3
    • 4.4.0, 4.3.4
    • karaf
    • None
    • Karaf 4.3.3

    Description

      The problem is we have own ConfigAdmin services which are initialized with null Dictionary configuration object (in the OSGi spec the NULL value is allowed).

      The problem the JsonInstaller always assumes that the configuration.getProcessedProperties always returns with existing instance of Dictionary.

       

                      Dictionary<String, Object> dictionary = configuration.getProcessedProperties(null);
                      File file = null;
                      if (dictionary.get(DirectoryWatcher.FILENAME) != null) {
                          file = getCfgFileFromProperty(configuration.getProperties().get(DirectoryWatcher.FILENAME));                }
      

      So there is a lot of exception in our case

       

      15:41:57.424 WARN  [CM Event Dispatcher (Fire ConfigurationEvent: pid=hu.blackbelt.judo.services.dispatcher.DefaultDispatcher.ed3c4b4a-3527-40c7-a2db-a2e0fb770767)] Can't update json configuration file
      java.lang.NullPointerException
      	at org.apache.karaf.config.core.impl.JsonConfigInstaller.configurationEvent(JsonConfigInstaller.java:136)
      	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.sendEvent(ConfigurationManager.java:1720)
      	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1662)
      	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:122)
      	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:84)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      15:41:57.425 WARN  [CM Event Dispatcher (Fire ConfigurationEvent: pid=hu.blackbelt.judo.services.dispatcher.DefaultIdentifierSigner.3c2f8f9d-c343-4c5f-a52b-91fd34d21095)] Can't update json configuration file
      java.lang.NullPointerException
      	at org.apache.karaf.config.core.impl.JsonConfigInstaller.configurationEvent(JsonConfigInstaller.java:136)
      	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.sendEvent(ConfigurationManager.java:1720)
      	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1662)
      	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:122)
      	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:84)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      15:41:57.425 WARN  [CM Event Dispatcher (Fire ConfigurationEvent: pid=hu.blackbelt.judo.services.dispatcher.DefaultActorResolver.23aeaa8c-85d2-439c-84a6-3d2c3e12e7ab)] Can't update json configuration file
      java.lang.NullPointerException
      	at org.apache.karaf.config.core.impl.JsonConfigInstaller.configurationEvent(JsonConfigInstaller.java:136)
      	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.sendEvent(ConfigurationManager.java:1720)
      	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1662)
      	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:122)
      	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:84)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      

      Attachments

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            robson@semmi.se Róbert Csákány
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: