[SNMP4J] ConcurrentModificationException

Robert Pierce rpierce at actionpacked.com
Fri Dec 20 01:30:14 CET 2013



Hi,
We've been noticing an occasional concurrentModificationExcpetion after upgrading to SNMP4J 2.2.3 from 2.0.1. Anybody have any thoughts on what might cause this  issue. We are running in a multithreaded environment with a single SNMP instance but multiple snmpTargets. There should only be one snmpTarget per thread. We are running our application on windows 7 64bit with Java 1.7u45.


java.util.ConcurrentModificationException

at java.util.Vector$Itr.checkForComodification(Vector.java:1156)

at java.util.Vector$Itr.next(Vector.java:1133)

at org.snmp4j.PDU.getBERPayloadLengthPDU(PDU.java:557)

at org.snmp4j.PDU.getBERLength(PDU.java:495)

at org.snmp4j.mp.MPv2c.prepareOutgoingMessage(MPv2c.java:122)

at org.snmp4j.MessageDispatcherImpl.sendPdu(MessageDispatcherImpl.java:479)

at org.snmp4j.Snmp.sendMessage(Snmp.java:1004)

at org.snmp4j.Snmp$PendingRequest.run(Snmp.java:1694)

at java.util.TimerThread.mainLoop(Timer.java:555)

at java.util.TimerThread.run(Timer.java:505)


Also, we have been seeing the BufferOverflowException that Baskar reported in Nov with the latest 2.2.3.  Does anybody know what Java bug this is related to.


java.nio.BufferOverflowException
at java.nio.Buffer.nextPutIndex(Buffer.java:513)
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:163)
at org.snmp4j.asn1.BEROutputStream.write(BEROutputStream.java:63)
at org.snmp4j.asn1.BER.encodeHeader(BER.java:118)
at org.snmp4j.smi.VariableBinding.encodeBER(VariableBinding.java:177)
at org.snmp4j.PDU.encodeBER(PDU.java:573)
at org.snmp4j.mp.MPv2c.prepareOutgoingMessage(MPv2c.java:130)
at org.snmp4j.MessageDispatcherImpl.sendPdu(MessageDispatcherImpl.java:472)
at org.snmp4j.Snmp.sendMessage(Snmp.java:1005)
at org.snmp4j.Snmp$PendingRequest.run(Snmp.java:1666)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)


Thanks,

Robert



More information about the SNMP4J mailing list