[SNMP4J] NPE when using V3

Beck, Dick Dick_Beck at ibi.com
Wed Nov 3 17:47:01 CET 2010


I am having terrible trouble with NotificationOriginatorImpl.sendNotification().
When I have V1 and V2 on and V3 off I get an NPE at
java.lang.NullPointerException
at org.snmp4j.smi.OctetString.<init>(OctetString.java:56)
at org.snmp4j.agent.mo.snmp.NotificationOriginatorImpl.sendNotification(NotificationOriginatorImpl.java:248)
at org.snmp4j.agent.mo.snmp.NotificationOriginatorImpl.notify(NotificationOriginatorImpl.java:339)
at org.snmp4j.agent.mo.snmp.NotificationOriginatorImpl.notify(NotificationOriginatorImpl.java:133)
at org.snmp4j.agent.AgentConfigManager.fireLaunchNotifications(AgentConfigManager.java:340)
at org.snmp4j.agent.AgentConfigManager.launch(AgentConfigManager.java:332)
at org.snmp4j.agent.AgentConfigManager.run(AgentConfigManager.java:242)

If I have V3 set on, no issues are seen.

I am using versions snmp4j_1.11.jar and snmp4j-agent-1.4.jar in my classpath.  JVM is 1.6.

It looks like the NPE is in SnmpTargetMIB.getLocalEngineID(). If MPV3 is null (which it is because the user asked for 1 and 2 only) the code returns a null, so there is not localEngineID.

If I call engineID = new OctetString(MPv3.createLocalEngineID()) I do get a value, if that matters.

Is this a known issue and is there any way around this?





More information about the SNMP4J mailing list