Search code examples
javared5

Red5chat connection iterator fails


Currently working on a flashchat that connects to red5.

The webapp used: http://www.freedevelopment.net/articles/free-red5chat.html

Users can connect, chat. But private messages and admin actions fail.

This is because of the following error:

Caused by: java.lang.ClassCastException: 
    java.util.concurrent.ConcurrentHashMap$Values
cannot be cast to java.util.Iterator at
net.freedevelopment.chat.Application.kick(Application.java:302)

The code there states:

public void kick(String _id) {
    Iterator<IConnection> it = scope.getConnections();
    //log.debug("kick called: "+_id);
    while (it.hasNext()) {
    IConnection conn = it.next();
    String id=conn.getClient().getId();
    if (!(_id.equals(id))) continue;
        if (conn instanceof IServiceCapableConnection) {
            ((IServiceCapableConnection) conn).invoke("IhaveBeenKicked", new Object[]{_id});
            log.info("kick "+_id);
        }   
    }
} // line 302

So I guess the iterator is not valid, but I have no clue to what this should be casted.

Thanx in advance!


Solution

  • Developer responded that this is a known problem, should be fixed in the near future.