powered by Jive Software

Openfire 3.6.2 Admin console bug. Exception on muc-room-affiliations.jsp page

When I try to add users to conference room and open “User Permissions” link (https://my.jabberserver.com:9091/muc-room-affiliations.jsp?roomJID=myroom%40conf erence.my.jabberserver.com&create=false) - sometimes it displays this error:

exception:

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
 at java.lang.String.substring(Unknown Source)
 at org.jivesoftware.openfire.admin.muc_002droom_002daffiliations_jsp._jspService(muc_002droom_002daffiliations_jsp.java:336)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
 at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
 at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
 at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
 at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
 at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
 at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:66)
 at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
 at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:42)
 at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
 at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:70)
 at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
 at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:146)
 at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
 at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
 at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
 at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
 at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
 at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
 at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
 at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
 at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
 at org.mortbay.jetty.Server.handle(Server.java:324)
 at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
 at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
 at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
 at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
 at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
 at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
 at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

This is because of illegal user name in Muc Room User list (name without @ symbol). And such names (they consists of group chat test fragments) appears in Muc Room User
list automatically and very often, without any visible reason.
I must delete this illegal names manually from database and restart server to apply changes.
Can you comment on this problem ?

Hi Stan,

Unfortunately, there are a number of bugs with the MUC administration part of the openfire console. Your only recourse is to manually clean up the database. You shouldn’t need to restart Openfire, I think…

daryl

Thanks for quick response, Daryl.

Unfortunatelly, there are no any way to reload list of conference room users without operfire service restart. Even “reload” option performs server restart. To reload list of conference room users without server restart we need to add new user by muc-room-affiliations.jsp page, but in our case this page returns only “Exception”.

I think there are two bugs:

  1. Some server-side disfunction, which fill room member list with random invalid values (this new jids contains text from room conversations - it seems like server bug). I have no idea when, where and WHY server perfoms these invalid changes.

2.muc-room-affiliations.jsp page litlle bug. This page performs string manipulations with room’s user list, namely it try to split each user name by “@” symbol without any acceptable exception handling. So, if user list contains at least one invalid name (without “@”) - we have only big useless “Exception”. If this page will process invalid names more correctly and display user list and “Add” button to us - it will allow to remove invalid names without SQL queries and reload user list without openfire service restart.

Ispect my opinion, please.

I can confirm that bug, it still exists (3.6.4). Server fills the table ofmucmembers with random garbage, but deleting it doesn’t help. I’m looking for the solution. The problem string of code is around that code:

muc-room-affiliations.jsp:336

<% if (room.getOutcasts().isEmpty()) { %>


<fmt:message key=“muc.room.affiliations.no_users” />


<% }
else {
ArrayList outcasts = new ArrayList(room.getOutcasts());
Collections.sort(outcasts);
for (String user : outcasts) {
String username = JID.unescapeNode(user.substring(0, user.indexOf(’@’)));
String rest = user.substring(user.indexOf(’@’), user.length());
String userDisplay = username + rest;

I can’t find what room.getOutcasts does. Where and what does it get from database?

This problem has simple solution - to avoid problems with admin-frontend functionality - add a few clauses to processing of these two lines:

String username = JID.unescapeNode(user.substring(0, user.indexOf(’@’)));

String rest = user.substring(user.indexOf(’@’), user.length());

But it’s hard to find reason of such confusing behavior of openfire server filling table with peaces of the chat-text.

Can confirm 3.6.4 is effected as well. Tried cleaning out the db, but can also confirm a restart is needed.

Is there a JIRA issue for this yet?

Is there a JIRA issue for this yet?
JM-1537

wroot wrote:

Is there a JIRA issue for this yet?
JM-1537

No, it’s another bug. I will have a look on this.

I’ve added OF-41 and OF-42 for the reported bugs.

I’ve commited my patch for OF-41 to the trunk version which fixes the StringIndexOutOfBoundsException. In my opinion the OF-42 patch need a review bevor committing it.

Thanks for your work. This patch will make openfire admin console better and resolve problem with muc-room-affiliation.jsp exception. I think this thread is closed from now.

But server-side problems with random inserts of chat-text into ofMucMember table are still active.