Red5chat 连接迭代器失败
目前正在开发一个连接到 red5 的 flashchat。
使用的网络应用程序: http://www.freedevelopment.net/articles/free-red5chat.html
用户可以连接、聊天。但私人消息和管理操作失败。
这是因为出现以下错误:
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)
那里的代码指出:
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
所以我猜迭代器无效,但我不知道应该转换什么。
提前致谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
开发者回应称这是一个已知问题,应该会在不久的将来修复。
Developer responded that this is a known problem, should be fixed in the near future.