Spark will not connect to server!

I am currently running an SBS server and had to upgrade my Exchange management console from service pack 1 to service pack 3. Afterwards, I rebooted my machine and now Spark will not start. This is the log message that I am getting every time I try to re-launch Spark. I have tried restarting the services, taskkilling the PID, clearing cache, and attempted to delete the .lck file (will not let me as the file is in use). I’m not very savvy when it comes to Java programming so any assistance would be appreciated. Thank you.

at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:58)

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)

at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)

at com.exe4j.runtime.WinLauncher.main(Unknown Source)

2015.01.13 15:04:40 org.jivesoftware.openfire.XMPPServer - Database could not be accessed

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: The database is already in use by another process: org.hsqldb.persist.NIOLockFile@c69e02e3[file =C:\Program Files (x86)\Openfire\embedded-db\openfire.lck, exists=true, locked=false, valid=false, fl =null]: java.lang.Exception: java.io.IOException: The process cannot access the file because another process has locked a portion of the file : C:\Program Files (x86)\Openfire\embedded-db\openfire.lck

at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager .java:151)

at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:754)

at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:480)

at org.jivesoftware.openfire.XMPPServer.(XMPPServer.java:212)

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.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:113)

at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:58)

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)

at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)

at com.exe4j.runtime.WinLauncher.main(Unknown Source)

2015.01.13 15:04:40 org.jivesoftware.openfire.XMPPServer - 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: The database is already in use by another process: org.hsqldb.persist.NIOLockFile@c69e02e3[file =C:\Program Files (x86)\Openfire\embedded-db\openfire.lck, exists=true, locked=false, valid=false, fl =null]: java.lang.Exception: java.io.IOException: The process cannot access the file because another process has locked a portion of the file : C:\Program Files (x86)\Openfire\embedded-db\openfire.lck

java.lang.IllegalArgumentException: 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: The database is already in use by another process: org.hsqldb.persist.NIOLockFile@c69e02e3[file =C:\Program Files (x86)\Openfire\embedded-db\openfire.lck, exists=true, locked=false, valid=false, fl =null]: java.lang.Exception: java.io.IOException: The process cannot access the file because another process has locked a portion of the file : C:\Program Files (x86)\Openfire\embedded-db\openfire.lck

at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:764)

at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:480)

at org.jivesoftware.openfire.XMPPServer.(XMPPServer.java:212)

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.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:113)

at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:58)

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)

at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)

at com.exe4j.runtime.WinLauncher.main(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: The database is already in use by another process: org.hsqldb.persist.NIOLockFile@c69e02e3[file =C:\Program Files (x86)\Openfire\embedded-db\openfire.lck, exists=true, locked=false, valid=false, fl =null]: java.lang.Exception: java.io.IOException: The process cannot access the file because another process has locked a portion of the file : C:\Program Files (x86)\Openfire\embedded-db\openfire.lck

at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager .java:151)

at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:754)

… 16 more

I should also mention that I am running server version 3.7.1.

The log says that database is already in use. When you relaunch it, it probably is already running in the background and that’s why you get such error. Maybe you have it installed as a service? When try stopping that service and try to run it via launcher. Ir may show some other error then.

Right now I have openfire-service.exe *32 running under the SYSTEM username. When I do nothing and try to run the launcher I receive the following log message below. Now, I will close out of the .exe running as a service and relaunch the launcher, sometimes I get the same error message as the one below, other times I get this:

Openfire 3.7.1 (Jan 14, 2015 9:30:57 AM)
Admin console listening at:
[http://server name]:xxx0
[https://server name]:xxx1

To me the above listing makes it appear as if Spark/Open Fire is working as expected, but end users are unable to connect to spark as they continue to receive the same error message as being unable to connect to the server or bad username. I also still can’t delete that .lck file as it says the file is in use. Please advise. Thank you.

(error from console that I get occasionally)

Database setup or configuration error: Please verify your database settings and check the logs/error.log file for detailed error messages.

java.lang.IllegalArgumentException: 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: The database is already in use by another process: org.hsqldb.persist.NIOLockFile@c69e02e3[file =C:\Program Files (x86)\Openfire\embedded-db\openfire.lck, exists=true, locked=false, valid=false, fl =null]: java.lang.Exception: java.io.IOException: The process cannot access the file because another process has locked a portion of the file : C:\Program Files (x86)\Openfire\embedded-db\openfire.lck

at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:764)

at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:480)

at org.jivesoftware.openfire.XMPPServer.(XMPPServer.java:212)

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.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:113)

at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:58)

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)

at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)

at com.exe4j.runtime.WinLauncher.main(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: The database is already in use by another process: org.hsqldb.persist.NIOLockFile@c69e02e3[file =C:\Program Files (x86)\Openfire\embedded-db\openfire.lck, exists=true, locked=false, valid=false, fl =null]: java.lang.Exception: java.io.IOException: The process cannot access the file because another process has locked a portion of the file : C:\Program Files (x86)\Openfire\embedded-db\openfire.lck

at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager .java:151)

at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:754)

… 16 more

ErrSo rerver haltsdtea

r

ting the server. Please check the log files for more information.

Instead of killing openfire-service process you can go to Services management console and stop the Openfire service. This is just an advice how to stop service correctly. But you shouldn’t do it. Just let the service run and do not run the launcher, as you will get the error about database being already in use again.

If you only run it as a service you can’t login in Spark? So installing Exchange SP or something else has broken something. Maybe firewall was enabled and 5222 port isn’t available for the clients. You can check and disable the firewall temporarily.

Thank you very much for your responses wroot. I greatly appreciate it I was able to resolve based on your suggestions after troubleshooting.

I always hate reading forums when people have issues and never posting a resolution so if anyone comes across this, this was my quick and easy resolution.

The first problem I had was those log messages that the data base was in use. I found that launching Spark through the Launcher is indeed the incorrect way to launch the server. Going through Windows Services and starting/restarting from there is the appropriate procedure.

The reason as to why after everything broke after the Exchange service pack upgrade was simply because the technician who was assisting with this kept experiencing failures when trying to upgrade that were caused by the Windows firewall. He had enabled it and disabled/removed approved applications without my knowledge. I left the firewall running as end-users were having no difficulties outside of the Spark application, but I went ahead and added C:\Program Files (x86)\Openfire\bin\openfire-service and allowed it to traverse through the Firewall. Once this was enabled the Spark application was able to communicate through to the server and everyone couldn’t be happier. A very easy resolution to my problem. Thanks again.

Just a minor correction. You keep calling both server and client Spark. This may confuse someone reading this later Server part is called Openfire, the client is Spark

Also, it is better to add a port rule for 5222 TCP port (incoming connection). Because if you update Openfire, openfire-service.exe will get updated and your rule will stop working as it operates with a hash of that file and it will change.