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

NPE in DependencyModel.getService() when @Bind method throws an exception

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • ipojo-runtime-1.10, ipojo-runtime-1.10.1
    • ipojo-runtime-1.11.0
    • iPOJO
    • None

    Description

      When a service binding callback throws an exception, the associated DependencyModel fails with an NPE.

      In the following log, the first exception is provoked. However, the second one is a bug inside the DependencyModel (m_tracker is null).

      2013.06.10 16:28:23 ERROR - Bundle: bugs.bug - [ERROR] : The method bindInstance in the implementation class bugs.NaughtyBinder throws an exception : E ≠ mc² - java.lang.NullPointerException: E ≠ mc²
      at bugs.NaughtyBinder.__M_bindInstance(NaughtyBinder.java:14)
      at bugs.NaughtyBinder.bindInstance(NaughtyBinder.java)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.apache.felix.ipojo.util.Callback.call(Callback.java:260)
      at org.apache.felix.ipojo.handlers.dependency.DependencyCallback.callOnInstance(DependencyCallback.java:309)
      at org.apache.felix.ipojo.handlers.dependency.Dependency.invokeCallback(Dependency.java:330)
      at org.apache.felix.ipojo.handlers.dependency.Dependency.onObjectCreation(Dependency.java:282)
      at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.__M_onCreation(DependencyHandler.java:702)
      at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.onCreation(DependencyHandler.java)
      at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:934)
      at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:156)
      at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
      at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:536)
      at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:418)
      at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:178)
      at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:307)
      at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:234)
      at org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:285)
      at org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:279)
      at org.apache.felix.ipojo.extender.internal.queue.JobInfoCallable.call(JobInfoCallable.java:100)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:679)
      2013.06.10 16:28:23 ERROR - Bundle: bugs.bug - [ERROR] bugs.NaughtyBinder : null - java.lang.NullPointerException
      at org.apache.felix.ipojo.util.DependencyModel.getService(DependencyModel.java:948)
      at org.apache.felix.ipojo.util.DependencyModel.getService(DependencyModel.java:938)
      at org.apache.felix.ipojo.handlers.dependency.Dependency.onObjectCreation(Dependency.java:280)
      at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.__M_onCreation(DependencyHandler.java:702)
      at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.onCreation(DependencyHandler.java)
      at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:934)
      at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:156)
      at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
      at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:536)
      at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:418)
      at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:178)
      at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:307)
      at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:234)
      at org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:285)
      at org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:279)
      at org.apache.felix.ipojo.extender.internal.queue.JobInfoCallable.call(JobInfoCallable.java:100)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:679)

      Attachments

        1. bug-project.zip
          1 kB
          Pierre Bourret

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            clement.escoffier Clement Escoffier
            pierre.bourret Pierre Bourret
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment