Hello Marcin,

The authoritative engine ID is the engine ID
that sends the trap. If you modify the local engine
ID of the trap sender with -l option in the command
line tool then it works because USM and MPv3 use
the same engine ID.

If you change the engine ID of the USM user then,
while sending the trap, the associated USM entry
is not found, because the engine IDs do not match.

Nevertheless, a NPE should not occur, of course.
I will investigate the issue for the next
release.

Best regards,
Frank


Marcin Kokoszka wrote:
> Hello Frank,
> 
> please find the stack trace below.
> 
> Listening on 192.168.0.9/162 <http://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 <f...@agentpp.com <mailto:f...@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@agentpp.org <mailto:SNMP4J@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
> 
> 

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

_______________________________________________
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j

Reply via email to