I am using snmp4j version 2.8.0 with Java version 8. I have followed the online examples in java that implements CommandResponder to receive SNMPv3 traps. I have also followed the suggestion from the topic SNMPV3 Trap listner to use
Snmp.discoverAuthorititiveEngineId to discover the engine ID of a SNMP entity.
I have multiple SNMP entities that I want to receive SNMP v3 traps from. So I added user for each snmp entity as below.
snmp.getUSM().addUser(new OctetString(agentSecName), engineID, user);
I receive snmpv3 traps from multiple snmp entities. But the problem that I am having is one in every few snmpv3 traps fail with different error each time. Some of the errors are as below. I believe the errors are based on the message received.
Error 1: java.io.IOException: Invalid sequence encoding: 55
Error 2: java.io.IOException: Data length > 4 bytes are not supported!
Error 3: java.io.IOException: Invalid sequence encoding: 0
How do I address this issue?
Thanks in advance for your help.