powered by Jive Software

Перенос базы данных

Здраствуйте помогите пожалуйста, по своей не опытности установил mssql evaluation лицензия кончилась я установил ms sql express перенес туда базу openfire. Но теперь при включение openfire выдает ошибку она ниже.
Конфигурация ws server 2019 , sql express 2019 , openfire v 4.5.1

020.11.06 15:22:08 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: com.microsoft.sqlserver.jdbc.SQLServerException: При входе в систему пользователя "sa" произошла ошибка. ClientConnectionId:9c8780c6-b7f9-4c3f-9c36-47d07b5ec3bc
	at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:204) ~[xmppserver-4.5.1.jar:4.5.1]
	at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1027) [xmppserver-4.5.1.jar:4.5.1]
	at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:680) [xmppserver-4.5.1.jar:4.5.1]
	at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:268) [xmppserver-4.5.1.jar:4.5.1]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_271]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [?:1.8.0_271]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [?:1.8.0_271]
	at java.lang.reflect.Constructor.newInstance(Unknown Source) [?:1.8.0_271]
	at java.lang.Class.newInstance(Unknown Source) [?:1.8.0_271]
	at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:4.5.1]
	at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:4.5.1]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_271]
	at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85) [i4jruntime.jar:?]
	at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94) [i4jruntime.jar:?]
	at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25) [i4jruntime.jar:?]
2020.11.06 15:22:08 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: com.microsoft.sqlserver.jdbc.SQLServerException: При входе в систему пользователя "sa" произошла ошибка. ClientConnectionId:9c8780c6-b7f9-4c3f-9c36-47d07b5ec3bc
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: com.microsoft.sqlserver.jdbc.SQLServerException: При входе в систему пользователя "sa" произошла ошибка. ClientConnectionId:9c8780c6-b7f9-4c3f-9c36-47d07b5ec3bc
	at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1037) ~[xmppserver-4.5.1.jar:4.5.1]
	at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:680) [xmppserver-4.5.1.jar:4.5.1]
	at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:268) [xmppserver-4.5.1.jar:4.5.1]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_271]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [?:1.8.0_271]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [?:1.8.0_271]
	at java.lang.reflect.Constructor.newInstance(Unknown Source) [?:1.8.0_271]
	at java.lang.Class.newInstance(Unknown Source) [?:1.8.0_271]
	at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:4.5.1]
	at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:4.5.1]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_271]
	at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85) [i4jruntime.jar:?]
	at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94) [i4jruntime.jar:?]
	at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25) [i4jruntime.jar:?]
Caused by: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 retries. The exception from the last attempt is as follows: com.microsoft.sqlserver.jdbc.SQLServerException: При входе в систему пользователя "sa" произошла ошибка. ClientConnectionId:9c8780c6-b7f9-4c3f-9c36-47d07b5ec3bc
	at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:204) ~[xmppserver-4.5.1.jar:4.5.1]
	at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1027) ~[xmppserver-4.5.1.jar:4.5.1]
	... 16 more

These errors show that Openfire is not able to connect to the database. My advice would be to review your database connection configuration.

скажите я правильно понимаю что это этот конфиг? и если это он что в нем не правильно?
сам openfire я не переустанавливал

<?xml version="1.0" encoding="UTF-8"?>

<!--
    This file stores bootstrap properties needed by Openfire.
    Property names must be in the format: "prop.name.is.blah=value"
    That will be stored as:
        <prop>
            <name>
                <is>
                    <blah>value</blah>
                </is>
            </name>
        </prop>

    Most properties are stored in the Openfire database. A
    property viewer and editor is included in the admin console.
-->
<!-- root element, all properties must be under this element -->
<jive> 
  <adminConsole> 
    <!-- Disable either port by setting the value to -1 -->  
    <port>9090</port>  
    <securePort>9091</securePort> 
  </adminConsole>  
  <locale>ru_RU</locale>  
  <!-- Network settings. By default, Openfire will bind to all network interfaces.
      Alternatively, you can specify a specific network interfaces that the server
      will listen on. For example, 127.0.0.1. This setting is generally only useful
       on multi-homed servers. -->  
  <!--
    <network>
        <interface></interface>
    </network>
    -->  
  <!--
        One time token to gain temporary access to the admin console.
    -->  
  <!--
    <oneTimeAccessToken>secretToken</oneTimeAccessToken>
    -->  
  <connectionProvider> 
    <className>org.jivesoftware.database.DefaultConnectionProvider</className> 
  </connectionProvider>  
  <database> 
    <defaultProvider> 
      <driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>  
      <serverURL>jdbc:sqlserver://127.0.0.1:1433;databaseName=sparkgm;applicationName=Openfire</serverURL>  
      <username encrypted="true">31d7c498d89485bf78d9657c2c0304f9</username>  
      <password encrypted="true">bc17bc8125cea6d4b2ab482a4696ad14b8bcbe7b75702850</password>  
      <testSQL>select 1</testSQL>  
      <testBeforeUse>false</testBeforeUse>  
      <testAfterUse>false</testAfterUse>  
      <testTimeout>500</testTimeout>  
      <timeBetweenEvictionRuns>30000</timeBetweenEvictionRuns>  
      <minIdleTime>900000</minIdleTime>  
      <maxWaitTime>500</maxWaitTime>  
      <minConnections>5</minConnections>  
      <maxConnections>100</maxConnections>  
      <connectionTimeout>1.0</connectionTimeout> 
    </defaultProvider> 
  </database>  
  <setup>true</setup>  
  <fqdn>openfire.mydomain</fqdn> 
</jive>

This is your database config. Make sure it still points to the right location, the database and tables names are the same and also username and password hashes are still true. If you are not sure, maybe rerunning Openfire’s setup and pointing to new database is a better option. To rerun Openfire setup at the bottom of this file change true to false in tag. Then run Openfire, go to Admin Console address and go through setup steps.

It is not clear how exactly have you migrated from one database to another. Have you dumped content of old database and imported it into the new one?

я копировал старую базу , потом удалил sql server установил новый закинул базу в папку и через sql managment studio подключил ее),Не силен в sql я так понимаю это не правильно)

Спасибо помогло, заработал

What exactly has helped? Rerunning the setup?

я создал новую базу данных в sql и в нее перенес ту которая была. И настройку перезапустил изменил в конце с true на false

1 Like