[SNMP4J] ConcurrentModificationException in tabular data

Fabian Nart fabian.nart at ergon.ch
Mon Mar 20 11:15:12 CET 2006


Hi,

I'm having trouble while retrieving tabular SNMP-data and proceed it 
with an Iterator. When I iterate through the received list of 
tableevents I get a ConcurrentModificationException. However, I'm pretty 
sure that my code doesn't touch the list at all (see code below).

The exception occurs in the line marked with ###. The _snmp is a 
reference to the single Snmp-object in my system. Is it possible that 
somewhere inside SNMP4j the returned List is modified after I've created 
my Iterator? (I've looked at the source but didn't see anything suspect, 
but maybe I overlooked something)

Unfortunately, I cannot reproduce this failure, it just showed up a few 
times -- but it should never occur, of course.

I'm grateful for any comments
Fabian


--- Code ----------------------------------------------------

TableUtils tu= new TableUtils(_snmp, new DefaultPDUFactory(PDU.GETBULK));

List rows= tu.getTable(_target, oids, lowerBoundIndex, upperBoundIndex);

for (Iterator i= rows.iterator(); i.hasNext();) {
   TableEvent row= (TableEvent) i.next(); // ###
   (...)
}

--- / Code --------------------------------------------------



More information about the SNMP4J mailing list