powered by Jive Software

[Bugfix] Issues with multiple conferences services

I’ve worte two patches for JM-1464.

  • createMUCService.patch: This patch should fix the bug that an admin is able to create Multi-User Chat services with an invalid service name.
  • createAndLoadRoom.patch: This patch should fix the problems with creating a room with same ID of the room in another service and that rooms migrates between different services.

The issue on creating new rooms (selecting the alphabetically first conference service in dropdown menu and not the current conference) service still exists.

Please test this patches and leave a comment.

Best Regards

Hi, thanks for your patches. I can’t test them as i cant get my Openfire SVN copy to compile with Netbeans. I have created the project as i did with Spark (and it is working) based on the doc http://www.igniterealtime.org/community/docs/DOC-1521 But it gives me an error:

clean:
Target “jar” does not exist in the project “Openfire”.
BUILD FAILED (total time: 0 seconds)

So, maybe someone else can test these patches, or maybe you can provide the compiled jars here.

Hi,

to test the patches, you can use the attached jars. These should work with all x86 and amd64 systems with a JDK > 1.5.0_17 from Sun. To install please follow the steps:

  1. Shutdown your openfire server
  2. Backup the file openfire.jar in the lib subfolder and the file admin-jsp.jar in the folder plugins/admin/webapp/WEB-INF/lib (relative to your Openfire folder).
  3. Replace the above files with the attached.
  4. Start your Openfire server.
  5. Enjoy multiple Groupchat services at your server :wink:

For the Netbeans problem see http://www.igniterealtime.org/community/message/191304#191304.

Best Regards
openfire.jar (6414874 Bytes)
admin-jsp.jar (806818 Bytes)

I have compiled your patches (does the order of applying is important?). I see that now it doesnt allow to create a service with a space. Underscores are not allowed as well. Why?

If i try to create the room with the same ID in the second service i get an exception:

java.lang.NullPointerException
     at org.jivesoftware.openfire.muc.spi.MUCPersistenceManager.loadFromDB(MUCPersistenceManager.java:169)
     at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl.getChatRoom(MultiUserChatServiceImpl.java:545)
     at org.jivesoftware.openfire.admin.muc_002droom_002dedit_002dform_jsp._jspService(muc_002droom_002dedit_002dform_jsp.java:178)
     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)

First, thank you for testing.

wroot schrieb:

I have compiled your patches (does the order of applying is important?). I see that now it doesnt allow to create a service with a space. Underscores are not allowed as well. Why?

The order doesn’t matter, they patch different files. The patch uses the JID class for validating, and yes, underscores are not allowed in domain names and therefore also not allowed in the name of XMPP components.

Your error log pushed me to have a look in the Database, for me it works, because I tried it so often, that the initial values are irrelevant. But I guess, your 2nd service was the first which you have created. So there is also a bug in initializing the database. I’ve wrote the initializeDB.patch to fix the relevant files for initializing the openfire database. But this means testing and fixing this bug is more complicated and doesn’t work yet for running systems.

Edited:

For running systems you have to create a second groupchat service and delete them before the fix is working.

This wasn’t a good idea (it was late yesterday) and includes a risk to delete all your room and conference settings as well.

Please apply all three patches (If you have already applied the fist and second, just apply the last one), clean up your installation (delete the target folder and recompile) and keep on testing .
initializeDB.patch (3768 Bytes)

I’m not familiar with the database updating process. So for running systems we should check the ofID table entry with idType=26 (SELECT * FROM ofID WHERE idType=26;) if the id is 1, we must only update this and set it to 2, but if not, we must check the ofMucService table if there are two entrys with serviceID 1 (SELECT * FROM ofMucService WHERE serviceID=1;) and get a new serviceID for one of them and copy all rooms from serviceID=1 to this new serviceID.

The patches should work fine for new installations but for running systems someone should write an update process which perform the above checks and corrections.

With third patch i got no exceptions. Great. Well, at least with the fresh installation. Maybe Gato or someone else will come up with the db updating process.

I wrote the described upgrade process. The repairDB patch is a replacement for the initializeDB patch. The openfire_3_6_4.tar.gz and openfire_3_6_4.zip are binary packages without a JRE (builded on the trunk version with the three patches). It should work with a actual JRE from Sun (version 1.6.0_10 or higher). Please review and test the patches and leave a comment.

Best Regards
repairDB.patch (20666 Bytes)
openfire_3_6_4.tar.gz (8194411 Bytes)
openfire_3_6_4.zip (9965940 Bytes)

I have compiled your patches again on a fresh trunk copy. Then i copied lib and resources/database folders to my existing testing server (3.6.4). After launching it i got the message that database update was successful. Muc services seem to behave correctly. I have attached your new patch to the ticket.

Thanks! The patches are related to the lib/openfire.jar file, the resources/database folder and the plugins/admin/webapp/WEB-INF/lib/admin-jsp.jar file. The admin-jsp.jar fixes the admin console pages (a nicer error message for invalid roomnames and a small bug for creating or editing rooms one of multiple conference services). But the admin console has no influence of the correct behavior of the MUC service.

So for applying my patches it should work to replace the described jar and sql files (from the attached archives) of your Openfire installation (Please make sure to stop Openfire before).

Ah yes, i have also copied the plugins/admin folder, just forgot to mention (i saw what was changed in the patch output). Muc administration is behaving correctly too.