powered by Jive Software

Issue when restart Openfire server after setup Openfire using MySQL with UTF-8 encode via a fresh installation

I recently experienced an issue when setup Openfire to use MySQL with UTF-8 encode via a fresh installation. Fortunately, this problem can be manually fix by editing the /etc/openfire/openfire.xml configuration file. But I wish it will be a better way to solve this problem :slight_smile:

Basic info:


I freshly installed the latest openfire on my Ubuntu machine. I followed the document (http://download.igniterealtime.org/openfire/docs/latest/documentation/database.html#mysql) to setup database configuration in web interface (http://localhost:9090), and I noticed that it mentions the Character Encoding Issues. So I setup database settings like this:

  • driver: com.mysql.jdbc.Driver
  • server: jdbc:mysql://

After finishing the setup, openfire will work fine until I restart the openfire server.

I end up figure out that in /etc/openfire/openfire.xml, the database tag is:

    <username encrypted="true">some_secret</username>  
    <password encrypted="true">some_secret</password>  
    <testSQL>select 1</testSQL>  

Notice the content of the <serverURL>, it seems that the & character has been escaped twice (& => &amp; => &amp;amp;) during the web interface put the database settings into openfire.xml, which later causes openfire server cannot (re)start correctly.

Fortunately, the problem can be manually fix.

After manually changing the serverURL tag in /etc/openfire/openfire.xml to:


and then restarting openfire server, everything was work fine.


Here is the /var/log/openfire/all.log file (https://pastebin.com/GCbHT2Dr) when restarting openfire server failed. Hope this help. Thanks!

Thanks for detailed report. I have filed this as https://issues.igniterealtime.org/browse/OF-1682

1 Like

A fix for this issue will be available in Openfire 4.4.0. The change has just been committed. Would someone be so kind as to test it?

Hello @guus,
I just updated my local OF and reinstalled it (mvn verify).
I havenโ€™t encountered this issue again, so it seems the correction is working as expected :sunny:


Excellent! Thanks for testing!