[SNMP4J] ArrayIndexOutOfBounds exception

Frank Fock fock at agentpp.com
Fri Nov 3 00:07:36 CET 2006


Hi Jason,

Thanks for reporting this one. I have fixed it for v1.8.
To work around the problem in v1.7.x, you could add a dummy 4th
message processing model and then remove it.

Best regards,
Frank

Konicki, Jason wrote:
> In my code I only want a MessageProcessingModel depending on the version
> a user wishes to select for their agent. I have recently seen a problem
> where the user selects V1 processing model, but they are receiving V2
> traps. I know this is a configuration problem on the users side, but I
> am getting an ArrayIndexOutOfBounds in processMessage method of the
> MessageDispatcherImpl when the following code is called.
> 
> MessageDispatcherImpl.processMessage():
> 
>       Integer32 version = new Integer32();
>       version.decodeBER(wholeMessage);
>       MessageProcessingModel mp =
>           (MessageProcessingModel) mpm.get(version.getValue());
> 
> Since the only MpM I have added is V1, when the v2 message is decoded,
> it tries to get the v2 model, which does not exist and therefore gets a
> ArrayIndexOutOfBounds exception.
> 
> Thanks,
> 
> Jason
> 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

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




More information about the SNMP4J mailing list