Openfire won't connect to mysql after server reboot

After installing Openfire for the first time, everything went smoothly and the server started without problems. However, after rebooting the server Openfire won’t start at all. This is what happens:

Starting Openfire

# sudo service openfire start
best java alternative in: /usr/lib/jvm/java-7-openjdk-amd64/jre
Starting openfire: openfire.
  • and nothing happens *

Error log is here:

It seems that Openfire cannot connect to mysql even though

  • The username and password are correct
  • I can log in to mysql with the same credentials from the command line: # mysql -u openfire -p
  • Mysql is running and is listening to port 3306
  • Mysql user ‘openfire’@‘localhost’ does have sufficient permissions
  • Everything worked perfectly before the reboot…

These are my database settings from /etc/openfire/openfire.xml:

    <username encrypted="true">c03b4b0f...</username>
    <password encrypted="true">637a448f...</password>
    <testSQL>select 1</testSQL>

I managed to start the server with a trick: I disabled write access to openfire.xml, started Openfire service and re-enabled the write access. Openfire then showed the setup page to which I entered all the settings again - and voilà - the server is up and running. However, nobody can actually log in to the xmpp server. Everybody just gets “Not Authorized” error exept the admin account that was updated during the setup. Deleting and re-installing server certificate on the client doesn’t work. The users are still in the database and are listed in the admin panel. This trick also reset all server settings. And if I restart openfire, it’s the same thing all over again (access denied for user ‘openfire’…)

Any help would be very much appreciated!

Sounds like Openfire is having trouble decrypting passwords. Have you checked if the encryption key that you used initially, and after the update, was indeed the same key?

Thank you for replying, but unfortunately I decided to uninstall Openfire and replace it with Prosody because after many many hours I couldn’t find a solution for this problem.