Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-8709

NullPointerException for JMX agents without entries in jmx-config.xml

    XMLWordPrintable

    Details

      Description

      If there is no entry in jmx-config.xml for an agent, a NPE is thrown which interrupts the JMX detector call, causing false negative detections. This was caused as part of the changes in commit f2a46021a6f9532c5faebb4967fe08f4c0031b2f. There was a null check in the code before that point.

      2016-09-02 15:30:50,216 INFO  [Provisiond-TaskScheduler-Thread] o.o.n.p.s.IpInterfaceScan: Exception occurred while trying to detect service JMX-Minion on address 127.0.0.1
      java.lang.NullPointerException
              at org.opennms.netmgt.provision.detector.jmx.GenericJMXDetectorFactory.getRuntimeAttributes(GenericJMXDetectorFactory.java:71) ~[opennms-detector-jmx-19.0.0-SNAPSHOT.jar:?]
              at org.opennms.netmgt.provision.detector.jmx.GenericJMXDetectorFactory.buildRequest(GenericJMXDetectorFactory.java:59) ~[opennms-detector-jmx-19.0.0-SNAPSHOT.jar:?]
              at org.opennms.netmgt.provision.detector.client.rpc.DetectorRequestBuilderImpl.execute(DetectorRequestBuilderImpl.java:149) ~[opennms-detectorclient-rpc-19.0.0-SNAPSHOT.jar:?]
              at org.opennms.netmgt.provision.service.DetectorRunner.supplyAsyncThenAccept(DetectorRunner.java:72) [opennms-provisiond-19.0.0-SNAPSHOT.jar:?]
              at org.opennms.core.tasks.AsyncTask.doSubmit(AsyncTask.java:82) [org.opennms.core.tasks-19.0.0-SNAPSHOT.jar:?]
              at org.opennms.core.tasks.AbstractTask.submitIfReady(AbstractTask.java:194) [org.opennms.core.tasks-19.0.0-SNAPSHOT.jar:?]
              at org.opennms.core.tasks.DefaultTaskCoordinator$2.run(DefaultTaskCoordinator.java:301) [org.opennms.core.tasks-19.0.0-SNAPSHOT.jar:?]
              at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626) [?:1.8.0_60]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_60]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_60]
              at org.opennms.core.concurrent.LogPreservingThreadFactory$2.run(LogPreservingThreadFactory.java:106) [opennms-util-19.0.0-SNAPSHOT.jar:?]
              at java.lang.Thread.run(Thread.java:745) [?:1.8.0_60]
      

        Attachments

          Activity

            People

            • Assignee:
              seth Seth Leger
              Reporter:
              seth Seth Leger
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: