This error means that two instances of Openfire are running and are struggling to access the database. Openfire 4.1.5 installs and runs the service automatically, so there is no need to run the launcher.
I am still not able to get Openfire to open or Spark to run. This is the error I get.
Database setup or configuration error: Please verify your database settings and check the logs/error.log file for detailed error messages.Error starting the server. Pelase
javal.hcang.IllegalArgueemntExceptio:cn java.sql.SQLException: ConnectionManager.getConnection)(k the log files for more information.
failed to obtain a connection after 11 retries. The exception from the last attempt is as follows: java.sql.SQLException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@c69e02e3[file =C:\Program Files (x86)\Openfire\embedded-db\openfire.lck, exists=true, locked=false, valid=false, ] method: checkHeartbeat read: 2017-08-22 22:10:06 heartbeat - read: -639 ms.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
Caused by: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 retries. The exception from the last attempt is as follows: java.sql.SQLException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@c69e02e3[file =C:\Program Files (x86)\Openfire\embedded-db\openfire.lck, exists=true, locked=false, valid=false, ] method: checkHeartbeat read: 2017-08-22 22:10:06 heartbeat - read: -639 ms.
at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager .java:156)
... 16 more
I have uninstalled and reinstalled Openfire and also the Spark program on my PC with no luck.
Stop Openfire (both the launcher and the service). Go to C:\Program Files (x86)\Openfire\embedded-db and delete the openfire.lck file (not the script one!). Run the service. Do not run the launcher (with the yellow light bulb icon). It's not meant to be used in production.
So I might be dumb but when I stop the service the openfire.lck file does not show in the embedded-db folder anymore. If I start the service it's there but obviously cannot delete it. What am I missing?
lck (lock) file usually should only show up when Openfire is running and database is in use. Sometimes it can get stuck, but it is not your case. So you only see the above error when you already have Openfire running via windows service and you also run the launcher (program with the yellow light bulb icon). This creates two instances of Openfire and they can't share one database. Don't run the launcher, you don't need it. Clients should already be able to connect. To connect to Admin Console just go to http://localhost:9090 in the browser on the same server (or to http://servername:9090 if connecting remotely and if servername is resolvable in the network).