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

NPE in LocalRepositoryImpl

    XMLWordPrintableJSON

    Details

      Description

      NPE due to time-of-check-to-time-of-check kind of bug. By the time LocalRepositoryImpl.serviceChanged gets called, the bundle may have been uninstalled, it seems. A patch for version 1.6.7-SNAPSHOT follows below the stack trace.

      ERROR: Bundle org.apache.felix.bundlerepository [29] EventDispatcher: Error during dispatch. (java.lang.NullPointerException)
      java.lang.NullPointerException
      at org.apache.felix.bundlerepository.impl.LocalRepositoryImpl.serviceChanged(LocalRepositoryImpl.java:71)
      at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:932)
      at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793)
      at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543)
      at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4346)
      at org.apache.felix.framework.Felix.registerService(Felix.java:3356)
      at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)
      at org.apache.felix.ipojo.IPojoFactory.start(IPojoFactory.java:615)
      at org.apache.felix.ipojo.Extender.createAbstractFactory(Extender.java:520)
      at org.apache.felix.ipojo.Extender.parse(Extender.java:301)
      at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:237)
      at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
      at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:772)
      at java.lang.Thread.run(Thread.java:662)

      Index: bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalRepositoryImpl.java
      ===================================================================
      — bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalRepositoryImpl.java (revision 1430286)
      +++ bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalRepositoryImpl.java (working copy)
      @@ -68,7 +68,7 @@
      public void serviceChanged(ServiceEvent event)
      {
      Bundle bundle = event.getServiceReference().getBundle();

      • if (bundle.getState() == Bundle.ACTIVE && event.getType() != ServiceEvent.MODIFIED)
        + if (bundle != null && bundle.getState() == Bundle.ACTIVE && event.getType() != ServiceEvent.MODIFIED)
        {
        synchronized (this)
        {

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rickhall Richard S. Hall
                Reporter:
                jnaous Jad Naous
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: