[SNMP4J] Null pointer in NotificationOriginatorImpl

Pellerin, Clement Clement_Pellerin at ibi.com
Thu Sep 9 21:17:40 CEST 2010


This code is part of NotificationOriginatorImpl.sendNotification()

      logger.info("Sent notification "+pdu+" to "+t);
      fireNotificationLogEvent(new NotificationLogEvent(this,
                               new OctetString(targetMIB.getLocalEngineID()),
                               t, new OctetString(targetMIB.getLocalEngineID()),
                               context, notificationID,
                               SNMPv2MIB.getSysUpTime(null).get(),
                               vbs));

This is the implementation of SnmpTargetMIB.getLocalEngineID()

public byte[] getLocalEngineID() {
    MPv3 mpv3 = (MPv3)
        messageDispatcher.getMessageProcessingModel(MessageProcessingModel.MPv3);
    if (mpv3 == null) {
      return null;
    }
    return mpv3.getLocalEngineID();
  }

I'm getting a NullPointerException in the OctetString constructor
new OctetString(targetMIB.getLocalEngineID()),
The local engine ID is unavailable because MPv3 processing is turned off.
My user only turned on MPv1 and MPv2c.

Is this a bug in snmp4j-1.11, a bug in my application or a user error?




More information about the SNMP4J mailing list