Karaf
  1. Karaf
  2. KARAF-1797

NPE thrown from OsgiConfiguration.unregister

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.5
    • Fix Version/s: 2.2.10, 2.3.0, 3.0.0
    • Component/s: karaf-core
    • Labels:
      None

      Description

      Passing in a null value for "realm" to unregister causes:

      2012-09-06 09:35:00,700 | ERROR | -70-091-thread-1 | tServiceReferenceRecipe$Listener | 8 - org.apache.aries.blueprint - 0.3.1.fuse-70-091 | Error calling listener method public void org.apache.karaf.jaas.config.impl.OsgiConfiguration.unregister(org.apache.karaf.jaas.config.JaasRealm,java.util.Map)
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_33]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_33]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
      at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
      at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:284)[8:org.apache.aries.blueprint:0.3.1.fuse-70-091]
      at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.invokeMethods(AbstractServiceReferenceRecipe.java:461)[8:org.apache.aries.blueprint:0.3.1.fuse-70-091]
      at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.unbind(AbstractServiceReferenceRecipe.java:430)[8:org.apache.aries.blueprint:0.3.1.fuse-70-091]
      at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.unbind(AbstractServiceReferenceRecipe.java:333)[8:org.apache.aries.blueprint:0.3.1.fuse-70-091]
      at org.apache.aries.blueprint.container.ReferenceListRecipe.untrack(ReferenceListRecipe.java:144)[8:org.apache.aries.blueprint:0.3.1.fuse-70-091]
      at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.serviceRemoved(AbstractServiceReferenceRecipe.java:275)[8:org.apache.aries.blueprint:0.3.1.fuse-70-091]
      at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.access$200(AbstractServiceReferenceRecipe.java:64)[8:org.apache.aries.blueprint:0.3.1.fuse-70-091]
      at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$1.run(AbstractServiceReferenceRecipe.java:245)[8:org.apache.aries.blueprint:0.3.1.fuse-70-091]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_33]
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_33]
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_33]
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_33]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_33]
      at java.lang.Thread.run(Thread.java:680)[:1.6.0_33]
      Caused by: java.lang.NullPointerException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_33]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_33]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
      at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
      at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:50)
      at org.apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java:31)
      at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78)
      at $Proxy11.equals(Unknown Source)[13:org.apache.karaf.jaas.config:2.2.5.fuse-70-091]
      at java.util.concurrent.CopyOnWriteArrayList.eq(CopyOnWriteArrayList.java:131)[:1.6.0_33]
      at java.util.concurrent.CopyOnWriteArrayList.remove(CopyOnWriteArrayList.java:484)[:1.6.0_33]
      at org.apache.karaf.jaas.config.impl.OsgiConfiguration.unregister(OsgiConfiguration.java:48)[13:org.apache.karaf.jaas.config:2.2.5.fuse-70-091]
      ... 18 more

      However there's some valid cases for this if the service is optional and not available. In my case it appears to be happening as part of installing a second jaas module.

        Issue Links

          Activity

            People

            • Assignee:
              Guillaume Nodet
              Reporter:
              Stan Lewis
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development