Getting concurrent modification exception on sending broadcast message in a room

Hello,

Hope you are doing well.

I am creating a chat support application using Openfire as the chat service. I use the restAPI plugin to communicate to/ from Openfire. I invoke apis of this RestAPI plugin to do various operations like add occupant to a chat room, remove occupants, create chat room etc.
I have a use case of sending a broadcast message to a chat room using MucRoom.sendPublicMessage(). Along with this an API is hit from another service to add an occupant to the same chat room. When these two apis are hit in parallel, I get a concurrent modification exception. This doesnt occur always. It is an intermittent issue. But wanted to check in this forum if this is a known issue . If yes, has it been fixed in later versions? Or is there a workaround to prevent this?
My openfire version : Openfire 4.7.6 Alpha
Rest API version: 1.10.2

Thanks a lot in advance

I missed to paste the exception in the above post

Caused by: java.util.ConcurrentModificationException
        at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1013) ~[?:?]
        at java.util.ArrayList$Itr.next(ArrayList.java:967) ~[?:?]
        at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1054) ~[?:?]
        at org.jivesoftware.openfire.muc.MUCRoom.broadcast(MUCRoom.java:1735) ~[xmppserver-4.7.6-SNAPSHOT.jar:4.7.6-SNAPSHOT]

Hi! Thanks for reporting this. This may have the same cause as the issue that I fixed in https://github.com/igniterealtime/openfire-restAPI-plugin/issues/188

Can you please try the latest ‘snapshot’ release of the plugin and let us know if that works for you? You can find the snapshot releases on the bottom of the plugin’s download page.