powered by Jive Software

Exception thrown whenever using connection.close()

whenever the connection.close() method is called, i get the following exception:

java.util.ConcurrentModificationException

at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:448)

at java.util.AbstractList$Itr.next(AbstractList.java:419)

at org.jivesoftware.smack.PacketReader.notifyConnectionError(PacketReader.java:227 )

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:317)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:77)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:103)

interestingly, when i close a connection through the jive admin console (which presumably calls the close() method), i see the error fly by. however, the connection is closed ok. when i run a close in my code, i get the exception AND the connection still shows as open.

i THINK (not sure) that this error flys by periodically during other actions as well, but can’'t verify this for sure. but i know that it does always happen on close().

any thoughts? thanks.

lateplate,

Thanks for the bug report. I’‘ve logged it into the issue tracker (SMACK-14) and we’‘ll post an update when we’‘ve been able to look into the issue further to try to figure out what’'s going on.

Regards,

Matt

lateplate,

A couple of weeks ago we checked in a fix for this problem. Are you using the latest daily build or the latest release version? Let me know if the problem still persists using the latest daily build.

Regards,

– Gato

gato,

i encountered this only on the latest RELEASE, not the daily build.

is there a significant detrimental effect to this not working properly? i found that, while not best practice, putting the close() in a try/catch can get the trick done. when the exception throws, i catch and bury the exception, and re-call the close() in the exception block. that seems to close out the session just fine, even though it’'s a bit ugly.

Since the error occurs after the connection was closed we could say that this error doesn’‘t generate serious consequences. Anyway, I’‘d recommend using the latest daily build which includes many bug fixes and it’'s quite stable.

If you decide to use the release version it’'s ok to add a try/catch. But remember to remove that code when moving to the latest version.

Regards,

– Gato