Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-1846

When updated configuration of component without a previously set target filter, NullPointerException is thrown

    XMLWordPrintableJSON

Details

    Description

      If the target filter is undefined for a component before a change is made to its configuration (in this case, by way of config admin and fileinstall) it will always throw this NullPointerException because the clause at the associated line of code is bad. It doesn't sufficiently guard for null return values for getTarget() before potentially dereferencing off getTarget()'s return.

      Workaround is to set any target filter, though that's not an acceptable workaround in my opinion... at least it works.

      If a target filter is set it seems to work as expected.

      ERROR Unexpected problem delivery configuration event to [org.osgi.service.cm.ConfigurationListener, id=24, bundle=3]
      java.lang.NullPointerException
      at org.apache.felix.scr.impl.manager.DependencyManager.canUpdateDynamically(DependencyManager.java:1068)
      at org.apache.felix.scr.impl.manager.ImmediateComponentManager.modify(ImmediateComponentManager.java:432)
      at org.apache.felix.scr.impl.manager.ImmediateComponentManager.reconfigure(ImmediateComponentManager.java:401)
      at org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationUpdated(ConfiguredComponentHolder.java:187)
      at org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:173)
      at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1693)
      at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:88)

      Attachments

        Activity

          People

            fmeschbe Felix Meschberger
            zacheryjensen Zachery Jensen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: