4 Replies Latest reply on Dec 22, 2016 12:16 AM by Jens

    database issue - the recipient cannot see the message

    Jens

      Hello,

      sometimes in a group chat window the posted messages are not visible. After a restart of the spark client (v2.8.0 Build 885) you can see that posts. We have installed the openfire server version 4.0.1 hosted on a windows server 2008r2.

      Is there any simple solution available for solving that problem? I found following error messages:

       

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

      1. 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:734)

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

      at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:169)

      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 org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:105)

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

      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)

      at com.install4j.runtime.launcher.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:156)

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

      ... 16 more

       

      At the server log:

       

      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)

      at com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)

      2016.12.21 10:57:29 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

        • Re: database issue - the recipient cannot see the message
          Hiren

          i can assume that it is connection error which occurs because there may me multiple instance of database has been opened and it is crosses limit of maximum limit of openfire.

           

          how many connection has been defined by you while setting up database configuration??

           

          this could be possible when you opened some connection instance and forgot to close after process has been completed when you restart your server all the instance are cleared and again you can set up new connection and it will work fine so track where does you forget to close the connection.

           

          i had set max connection to 25 and i never got this error after closing instance's after process has been completed.

           

           

          this is my database config hope it will help you to figure out your issue.

            • Re: database issue - the recipient cannot see the message
              Jens

              Thank you for your answer, but it seems to be ok. I think, that is not the problem. Do you have another idea?

                • Re: database issue - the recipient cannot see the message
                  Hiren

                  have you used the same database for any other server or process?

                   

                  because i was also facing the same problem of max connection has been opened and i fixed it that way i was opening connection from backend and not closing it and it cause the same error after closing those connection i never faced this again.

                    • Re: database issue - the recipient cannot see the message
                      Jens

                      Thanks for your suggestion. I hate to say this, but I have no idea how I can open connections from the back end. I think I'm on the wrong way. The database error message appeared when I tried to start the server from the console additional while it was running as a service. Today I did not try to start that server and so I have not this error message.

                      1)

                      But the problem still exists: When I type some text into the Spark client's group chat window and press enter then this text will not be written into the chat window. But! When I restart (or log off log on) the Spark client then the text exists in the chat window.

                      2)

                      But some other users cannot reproduce this problem. Spark chat works like expected.

                       

                      ==>

                      I cannot find the solution or a difference. So I tried to delete all the profile information inclusive the folder %userprofile%\Application Data\Spark. But that was no solution.