[SNMP4J] NullPointerException when closing DefaultUDPTransportMapping

Andy Coulbeck andrew.coulbeck at unboundid.com
Mon May 24 17:17:26 CEST 2010


It looks like there is a race condition in snmp4j-1.11 DefaultUDPTransportMapping when closing the SNMP client session.  Occasionally we see the following error.

'An uncaught exception during processing for thread DefaultUDPTransportMapping_10.5.1.82/0 has caused it to terminate abnormally.  The stack trace for that exception is:  java.lang.NullPointerException#0A  org.snmp4j.transport.DefaultUdpTransportMapping$ListenThread.run(DefaultUdpTransportMapping.java:404)#0A  java.lang.Thread.run(Thread.java:619)

The value of 'socket' could be set to null between lines 403 and 404 (presumably by the thread that is in the close method).

403:        if (socket != null) {
404:          socket.close();
405:        }




More information about the SNMP4J mailing list