River
  1. River
  2. RIVER-402

NullPointerException in LookupCacheImpl.notifyServiceMap

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: River_2.1.2
    • Fix Version/s: None
    • Component/s: net_jini_lookup
    • Labels:
      None

      Description

      One of our automated tests fails periodically (roughly 1 in 5 times), due to the ServiceDiscoveryListener.serviceRemoved method not getting called sometimes. This seems to be due to a NullPointerException in LookupCacheImpl.notifyServiceMap, which seems to be triggered by us calling JoinManager.terminate. This is on Apache River 2.2.0.

      Exception as follows:

      java.lang.NullPointerException: null
      at net.jini.lookup.ServiceDiscoveryManager$LookupCacheImpl.notifyServiceMap(ServiceDiscoveryManager.java:1890) ~[jini-ext-2.2.0.jar:na]
      at net.jini.lookup.ServiceDiscoveryManager$LookupCacheImpl.access$300(ServiceDiscoveryManager.java:843) ~[jini-ext-2.2.0.jar:na]
      at net.jini.lookup.ServiceDiscoveryManager$LookupCacheImpl$LookupListener.notify(ServiceDiscoveryManager.java:859) ~[jini-ext-2.2.0.jar:na]
      at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source) ~[na:na]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_27]
      at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_27]
      at net.jini.jeri.BasicInvocationDispatcher.invoke(BasicInvocationDispatcher.java:1126) ~[jini-ext-2.2.0.jar:na]
      at net.jini.jeri.BasicInvocationDispatcher.dispatch(BasicInvocationDispatcher.java:608) ~[jini-ext-2.2.0.jar:na]
      at com.sun.jini.jeri.internal.runtime.Target$2.run(Target.java:487) ~[jini-ext-2.2.0.jar:na]
      at net.jini.export.ServerContext.doWithServerContext(ServerContext.java:103) ~[jini-ext-2.2.0.jar:na]
      at com.sun.jini.jeri.internal.runtime.Target.dispatch(Target.java:484) ~[jini-ext-2.2.0.jar:na]
      at com.sun.jini.jeri.internal.runtime.Target.access$000(Target.java:57) ~[jini-ext-2.2.0.jar:na]
      at com.sun.jini.jeri.internal.runtime.Target$1.run(Target.java:464) ~[jini-ext-2.2.0.jar:na]
      at com.sun.jini.start.AggregatePolicyProvider$AggregateSecurityContext$2.run(AggregatePolicyProvider.java:527) ~[start-2.2.0.jar:na]
      at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0_27]
      at com.sun.jini.jeri.internal.runtime.Target.dispatch(Target.java:461) ~[jini-ext-2.2.0.jar:na]
      at com.sun.jini.jeri.internal.runtime.Target.dispatch(Target.java:426) ~[jini-ext-2.2.0.jar:na]
      at com.sun.jini.jeri.internal.runtime.DgcRequestDispatcher.dispatch(DgcRequestDispatcher.java:210) ~[jini-ext-2.2.0.jar:na]
      at net.jini.jeri.connection.ServerConnectionManager$Dispatcher.dispatch(ServerConnectionManager.java:147) ~[jini-ext-2.2.0.jar:na]
      at com.sun.jini.jeri.internal.mux.MuxServer$1$1.run(MuxServer.java:244) ~[jini-ext-2.2.0.jar:na]
      at com.sun.jini.start.AggregatePolicyProvider$AggregateSecurityContext$1.run(AggregatePolicyProvider.java:513) ~[start-2.2.0.jar:na]
      at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0_27]
      at com.sun.jini.jeri.internal.mux.MuxServer$1.run(MuxServer.java:241) ~[jini-ext-2.2.0.jar:na]
      at com.sun.jini.thread.ThreadPool$Worker.run(ThreadPool.java:136) ~[jini-ext-2.2.0.jar:na]
      at java.lang.Thread.run(Thread.java:662) ~[na:1.6.0_27]
      at com.sun.jini.jeri.internal.runtime.Util._________EXCEPTION_RECEIVED_FROM_SERVER_________(Util.java:108) ~[jini-ext-2.2.0.jar:na]
      at com.sun.jini.jeri.internal.runtime.Util.exceptionReceivedFromServer(Util.java:101) ~[jini-ext-2.2.0.jar:na]
      at net.jini.jeri.BasicInvocationHandler.unmarshalThrow(BasicInvocationHandler.java:1303) ~[jini-ext-2.2.0.jar:na]
      at net.jini.jeri.BasicInvocationHandler.invokeRemoteMethodOnce(BasicInvocationHandler.java:832) ~[jini-ext-2.2.0.jar:na]
      at net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocationHandler.java:659) ~[jini-ext-2.2.0.jar:na]
      at net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.java:528) ~[jini-ext-2.2.0.jar:na]
      at $Proxy28.notify(Unknown Source) ~[na:na]
      at com.sun.jini.reggie.RegistrarImpl$EventTask.run(RegistrarImpl.java:1863) ~[reggie-2.2.0.jar:na]
      at com.sun.jini.thread.TaskManager$TaskThread.run(TaskManager.java:331) [jini-ext-2.2.0.jar:na]

        Activity

        Hide
        Neil Ferguson added a comment -

        This seems to happen because the item field passed-in to the notifyServiceMap method is null (I think this is expected, because a service is being removed), and this causes a NPE when trying to create a log message.

        Setting the log level to INFO fixes the problem.

        Show
        Neil Ferguson added a comment - This seems to happen because the item field passed-in to the notifyServiceMap method is null (I think this is expected, because a service is being removed), and this causes a NPE when trying to create a log message. Setting the log level to INFO fixes the problem.
        Hide
        Hudson added a comment -

        Integrated in River-trunk-jdk7 #4 (See https://builds.apache.org/job/River-trunk-jdk7/4/)
        River-402 Fix null pointer exception

        Show
        Hudson added a comment - Integrated in River-trunk-jdk7 #4 (See https://builds.apache.org/job/River-trunk-jdk7/4/ ) River-402 Fix null pointer exception
        Hide
        Hudson added a comment -

        Integrated in River-trunk #503 (See https://builds.apache.org/job/River-trunk/503/)
        River-402 Fix null pointer exception

        Show
        Hudson added a comment - Integrated in River-trunk #503 (See https://builds.apache.org/job/River-trunk/503/ ) River-402 Fix null pointer exception
        Hide
        Peter Firmstone added a comment -

        Thanks Neil, for reporting this bug, we should have a new release out in the next few months, including the fix.

        Show
        Peter Firmstone added a comment - Thanks Neil, for reporting this bug, we should have a new release out in the next few months, including the fix.
        Hide
        Greg Trasuk added a comment -

        I believe this fix is in trunk but not 2.2.1 maintenance release.

        Show
        Greg Trasuk added a comment - I believe this fix is in trunk but not 2.2.1 maintenance release.

          People

          • Assignee:
            Peter Firmstone
            Reporter:
            Neil Ferguson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development