When using java nio I get this exception. It does not happen on Sun jvm with exactly the same code so it might be due do synchronization problems in AbstractSelectableChannel.java. In the code of this class, it seems the LinkedList can be modified by addSelectionKey and removeSelectionKey without locking on blockingLock(), I don't know if it is the problem.
java.util.ConcurrentModificationException at java.util.LinkedList$LinkedListItr.checkMod(LinkedList.java:800) at java.util.LinkedList$LinkedListItr.next(LinkedList.java:852) at java.nio.channels.spi.AbstractSelectableChannel.locate(AbstractSelect ableChannel.java:203) at java.nio.channels.spi.AbstractSelectableChannel.register(AbstractSele ctableChannel.java:242) at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(Socke tIoProcessor.java:166) at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$2(Socke tIoProcessor.java:143) at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(Soc ketIoProcessor.java:554) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43) at java.lang.Thread.run(Thread.java:741) at java.lang.VMThread.run(VMThread.java:53) at java.lang.VMThread$1.Invoke(VMThread.java:303) at cli.System.Threading.ThreadHelper.ThreadStart_Context(Unknown Source) at cli.System.Threading.ExecutionContext.Run(Unknown Source) at cli.System.Threading.ThreadHelper.ThreadStart(Unknown Source) It appears also sometimes as this exception: java.lang.NullPointerException at java.util.LinkedList$LinkedListItr.<init>(LinkedList.java:787) at java.util.LinkedList.listIterator(LinkedList.java:640) at java.util.AbstractList.listIterator(AbstractList.java:407) at java.nio.channels.spi.AbstractSelectableChannel.locate(AbstractSelectableChannel.java:199) at java.nio.channels.spi.AbstractSelectableChannel.register(AbstractSelectableChannel.java:242) at org.apache.mina.transport.socket.nio.SocketIoProcessor.doAddNew(SocketIoProcessor.java:166) at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$2(SocketIoProcessor.java:143) at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:554) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43) at java.lang.Thread.run(Thread.java:741) at java.lang.VMThread.run(VMThread.java:53) at java.lang.VMThread$1.Invoke(VMThread.java:303) at cli.System.Threading.ThreadHelper.ThreadStart_Context(Unknown Source) at cli.System.Threading.ExecutionContext.Run(Unknown Source) at cli.System.Threading.ThreadHelper.ThreadStart(Unknown Source) Thanks -- Summary: ConcurrentModificationException using java.nio.channels.spi.AbstractSelectableChannel Product: classpath Version: 0.93 Status: UNCONFIRMED Severity: normal Priority: P3 Component: classpath AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: cyprien dot noel at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30892 _______________________________________________ Bug-classpath mailing list Bug-classpath@gnu.org http://lists.gnu.org/mailman/listinfo/bug-classpath