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

collection:collect command fails with ClassCastException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 22.0.0
    • Fix Version/s: 22.0.0
    • Component/s: None
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Sprint:
      Horizon - March 21st 2018

      Description

      Since the refactoring done as part of HZN-1202, invoking the SnmpCollector via the collection:collect command in the Karaf shell fails with a ClassCastException.

      Caused by: org.opennms.netmgt.collection.api.CollectionException: Unexpected error during node SNMP collection for: 127.0.0.1
      at org.opennms.netmgt.collectd.SnmpCollector.collect(SnmpCollector.java:265)
      at org.opennms.netmgt.collection.client.rpc.CollectorClientRpcModule$1.get(CollectorClientRpcModule.java:83)
      at org.opennms.netmgt.collection.client.rpc.CollectorClientRpcModule$1.get(CollectorClientRpcModule.java:77)
      at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
      ... 3 more
      Caused by: java.lang.ClassCastException: org.opennms.netmgt.collection.core.DefaultCollectionAgent cannot be cast to org.opennms.netmgt.collectd.SnmpCollectionAgent
      at org.opennms.netmgt.collectd.SnmpCollector.collect(SnmpCollector.java:232)
      

      We need to address this so that the command works again.

      Also, this same error message previously appeared when the collector was invoked without specifying a node id. We could also take advantage of this opportunity to fail with a clearer exception.

        Attachments

          Activity

            People

            • Assignee:
              j-white Jesse White
              Reporter:
              j-white Jesse White
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: