[SNMP4J] Problem with SNMPv3 Trap Receiver

Marcin Kokoszka mkokoszka82 at gmail.com
Thu May 28 09:11:23 CEST 2009


Hello Frank,

please find the stack trace below.

Listening on 192.168.0.9/162
2009-05-28 09:01:48 org.snmp4j.log.JavaLogAdapter log
SEVERE: java.lang.NullPointerException
java.lang.NullPointerException
    at org.snmp4j.security.AuthGeneric.authenticate(AuthGeneric.java:96)
    at org.snmp4j.security.AuthGeneric.isAuthentic(AuthGeneric.java:136)
    at org.snmp4j.security.USM.processIncomingMsg(USM.java:660)
    at org.snmp4j.mp.MPv3.prepareDataElements(MPv3.java:1073)
    at
org.snmp4j.MessageDispatcherImpl.dispatchMessage(MessageDispatcherImpl.java:263)
    at
org.snmp4j.MessageDispatcherImpl.processMessage(MessageDispatcherImpl.java:347)
    at
org.snmp4j.util.MultiThreadedMessageDispatcher$MessageTask.run(MultiThreadedMessageDispatcher.java:203)
    at org.snmp4j.util.ThreadPool$TaskManager.run(ThreadPool.java:239)

Best regards
Marcin

2009/5/27 Frank Fock <fock at agentpp.com>

> Hello Marcin,
>
> Can you send me the NPE stacktrace?
>
> Best regards,
> Frank
>
> Marcin Kokoszka wrote:
>
>> Hello Frank,
>>
>> I have created some simply trap receiver (using the SNMP4J command line
>> tool
>> as an example).
>> I'm adding the users manually to the USM Table:
>>
>> ....
>>
>> OctetString localEngineID = new OctetString(MPv3.createLocalEngineID());
>>            USM usm = new USM(SecurityProtocols.getInstance(),
>> localEngineID, 0);
>>            usm.setEngineDiscoveryEnabled(true);
>>            SecurityModels.getInstance().addSecurityModel(usm);
>> ....
>>
>> snmp.getUSM().addUser(securityName, new UsmUser(securityName,
>> authProtocol,
>> authPassphrase, privProtocol, privPassphrase,
>> OctetString.fromHexString("ED:0C:00:00:03:00:60:A7:01:56:E5", ':')));
>>
>> ....
>>
>> The engin ID is also entered manually. The strange thing is that when I'm
>> sending the SNMPv3 Trap to my trap receiver with command (the same engine
>> id):
>>
>> java -jar SNMP4J.jar -p TRAP -v 3 -u user -a MD5 -A password -x DES -P
>> password -l 0xED:0C:00:00:03:00:60:A7:01:56:E5......
>>
>> I'm receiving always the "SEVERE: java.lang.NullPointerException".
>> When I will add the same user but without the EnginId:
>>
>> ....
>> snmp.getUSM().addUser(securityName, new UsmUser(securityName,
>> authProtocol,
>> authPassphrase, privProtocol, privPassphrase ));
>> ...
>>
>> and use the same command to send the SNMPv3 trap everything seems to be
>> ok.
>> The EngineId is discovered automatically.
>>
>> Do You have any clues where is the problem?
>>
>> Best regards
>> Marcin
>> _______________________________________________
>> 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