[SNMP4J] NPE when using V3

Frank Fock fock at agentpp.com
Wed Nov 3 20:35:44 CET 2010


Hi,

This has been already fixed. You can see the fix in the latest
snapshot at:
https://server.oosnmp.net/dist/snapshot/org/snmp4j/snmp4j-agent/1.4-SNAPSHOT/

Best regards,
Frank

On 03.11.2010 17:47, Beck, Dick wrote:
> 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?
>
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list