Problem connection to the database with Openfire 4.7 and SQL Server 11.0.75 database on Windows Server 2012 R2

Hi,
I have a problem with the connection in the configuration of the external database with SQL Server 11.0.7507 with the user that comes by default with the Openfire 4.7.0 database, which is admin. In the log file I get the following:

e[32mINFO e[m [Jetty-QTP-AdminConsole-11308]: org.jivesoftware.database.DbConnectionManager - Unable to get a connection from the database pool (attempt 10 out of 10).
com.microsoft.sqlserver.jdbc.SQLServerException: Error de inicio de sesión del usuario 'admin'. ClientConnectionId:1f4bcaec-76c8-4ed3-925e-794e419a6cb7
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:283) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:129) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:37) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:5067) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3731) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:94) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3675) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2979) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2488) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2142) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1993) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1164) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:760) ~[mssql-jdbc-7.4.1.jre8.jar:?]
	at java.sql.DriverManager.getConnection(Unknown Source) ~[?:1.8.0_321]
	at java.sql.DriverManager.getConnection(Unknown Source) ~[?:1.8.0_321]
	at org.apache.commons.dbcp2.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:121) ~[commons-dbcp2-2.9.0.jar:2.9.0]
	at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:374) ~[commons-dbcp2-2.9.0.jar:2.9.0]
	at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:918) ~[commons-pool2-2.9.0.jar:2.9.0]
	at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:431) ~[commons-pool2-2.9.0.jar:2.9.0]
	at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:356) ~[commons-pool2-2.9.0.jar:2.9.0]
	at org.apache.commons.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:141) ~[commons-dbcp2-2.9.0.jar:2.9.0]
	at org.jivesoftware.database.DefaultConnectionProvider.getConnection(DefaultConnectionProvider.java:91) ~[xmppserver-4.7.0.jar:4.7.0]
	at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:171) ~[xmppserver-4.7.0.jar:4.7.0]
	at org.jivesoftware.database.DbConnectionManager.testConnection(DbConnectionManager.java:122) ~[xmppserver-4.7.0.jar:4.7.0]
	at org.jivesoftware.openfire.admin.setup.setup_002ddatasource_002dstandard_jsp._jspService(setup_002ddatasource_002dstandard_jsp.java:278) ~[xmppserver-4.7.0.jar:4.7.0]
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71) ~[apache-jsp-8.5.54.jar:8.5.54]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar:3.1.0]
	at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1459) ~[jetty-servlet-9.4.43.v20210629.jar:9.4.43.v20210629]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[jetty-servlet-9.4.43.v20210629.jar:9.4.43.v20210629]
	at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1626) ~[jetty-servlet-9.4.43.v20210629.jar:9.4.43.v20210629]```
I don't know what I need to configure.
Can someone help me to do it step by step?
Thanks a lot.

Do Openfire credential have access to the server? I used JDBC long ago and in my fade knowledge You need to be able to connect to MSSQL via Management studio with same credentials. Have you tried that?

Hi,
I am in the configuration wizard where I have to select the database configuration. I choose the standard connection indicating the name of the server, the port and the name of the database that I install from the openfire resources folder.
I have tried with several users and it always gives me the same error.
With the command select from * ofUser it tells me that the user and password is admin, admin. I have not created any user in for the SQL database. I don’t know if I have to.
I have the latest version of Java installed.
I have also tried with the system users and it gives me the same error.
I don’t know what steps to follow to make it work.
Can you tell me what steps I have to follow to the letter?
Thank you very much for your help.
All the best.

As far as I remember Java Stuff and in my experience with other systems, you have to create the user credentials as well as the database

Hi,
I already have the database created but the user does not. I’ll create it and then I’ll tell you.
The database uses the one that comes with openfire wnn the resources folder.
Thanks a lot.
All the best

1 Like

I think that you’re confusing which ‘users’ are used where.The Openfire users cannot be used to access the database (instead, Openfire typically gets its users from the database). The authentication that is performed to connect Openfire to the database has nothing to do with the default admin account that Openfire sometimes creates at the end of the setup. To allow Openfire to connect to your database, you will have to create a database-user using the management software of your database. Afterwards, you can use the credentials of that user to configure the database connection in Openfire.

In agreement. I will create the user and try the connection again. I’ll let you know later. Thanks a lot.

Hi,
Wooowww, Now it works.
But I have the following error when configuring the profile through the ldap server after the user mapping step:

HTTP ERROR 500 java.lang.NullPointerException
URI: /setup/setup-admin-settings.jsp
STATUS: 500
MESSAGE: java.lang.NullPointerException
SERVLET: org.jivesoftware.openfire.admin.setup.setup_002dadmin_002dsettings_jsp
CAUSED BY: java.lang.NullPointerException
Caused by:

java.lang.NullPointerException
at org.jivesoftware.openfire.admin.setup.setup_002dadmin_002dsettings_jsp._jspService(setup_002dadmin_002dsettings_jsp.java:219)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1459)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1626)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:73)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:49)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:226)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:234)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:386)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
at java.lang.Thread.run(Unknown Source)
Can someone tell me what I have misconfigured or what I have to configure?
Thank you very much for your help.
All the best.

Hi,
Any. Forget you. Already solved.
I wasn’t specifying what type of LDAP.
Thanks for everything.

1 Like

Hi,
Sorry for the inconvenience
Now I have the problem when I did everything by default in a first test.
When trying to enter the web console it hangs and does not enter.
Does anyone know why this happens?
Thanks you very much.
All the best.

Hi,
Conversations between users with spark work for me but I can’t enter the web administration console.
Can someone help me with this?
Thanks a lot.
All the best.

Hi,
The problem is only to access http://127.0.0.1:9090/index.jsp, because if I enter the following address http://127.0.0.1:9090/user-summary.jsp it lets me enter without problems.
How can I solve that?
Does anyone know how to fix it for the latest version of Openfire?
Thanks a lot.
All the best.

Hi,
There is a user who did this and it works for him:

  1. launch web browser and enter: http://localhost:9090/server-properties.jsp
  2. then delete: xmpp.multiplex.tls.policy
    But I look for that property and it does not exist in this version.
    Perhaps this is the solution knowing which property is the one with the conflict.
    I hope someone has experienced the same and can point it out.
    Thank you so much for everything.
    All the best.