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

Setting a configuration parameter to null throws an NPE.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.3.6
    • None
    • karaf
    • None

    Description

      Setting a configuration parameter to null throws a NullPointerException. The specification, https://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.configurator.html, is silent on the use of null as a property value, but includes the following "If a requested conversion cannot be performed, then the configuration is not processed and the Configurator implementation should log an error."; in addition the configuration parameter are stored in a Dictionary structure which requires a non-null key and non-null value. Although the json format supports 'null' as value and OSGi confutation appears to required non-null values, should Karaf log something like "Null value for <Property Name> not supported." instead of throwing a NPE?

      Thrown exception

      java.lang.NullPointerException: null at org.apache.karaf.config.core.impl.JsonConfigInstaller.setConfig(JsonConfigInstaller.java:87) ~[?:?] at org.apache.karaf.config.core.impl.JsonConfigInstaller.update(JsonConfigInstaller.java:66) ~[?:?] at org.apache.felix.fileinstall.internal.DirectoryWatcher.update(DirectoryWatcher.java:1117) [!/:3.7.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.update(DirectoryWatcher.java:919) [!/:3.7.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:488) [!/:3.7.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [!/:3.7.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [!/:3.7.4]

      etc/foo.json

      {    "myNullValue":null }

      Attachments

        Activity

          People

            Unassigned Unassigned
            paulsp Paul Spencer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: