powered by Jive Software

Openfire forgets LDAP info on restart

I am running openfire on Microsoft SBS Server 2008 / MSSQL2008.(using windows-sql auth)

Everything works fine until I restart the computer or the openfire service.

Then my users can not log in with spark (or any other client) and I can not log in to the admin page.

I get an error in several of the log files about a nullpointerexception and in one of them (sorry, don’t remember which) that openfire can not get ‘DC=[NULL]’ from the LDAP server


Did a complete reinstall and now I am getting these errors:

Warn.log:

2009.12.28 14:07:52 Failed to create the connection provider specified by connectionProvider.className. Using the default pool. java.lang.NullPointerException at java.util.Hashtable.put(Unknown Source) at java.util.Properties.setProperty(Unknown Source) at org.jivesoftware.database.DefaultConnectionProvider.start(DefaultConnectionProvider.java:92) at org.jivesoftware.database.DbConnectionManager.setConnectionProvider(DbConnectionManager.java:490) at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:79) at org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:335) at org.jivesoftware.util.JiveProperties.init(JiveProperties.java:73) at org.jivesoftware.util.JiveProperties$JivePropertyHolder.(JiveProperties.java:40) at org.jivesoftware.util.JiveProperties.getInstance(JiveProperties.java:52) at org.jivesoftware.util.JiveGlobals.getProperty(JiveGlobals.java:532) at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:298) at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:415) at org.jivesoftware.openfire.XMPPServer.(XMPPServer.java:161) 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:106) at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:51) 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$1.run(Unknown Source)

error.log

2009.12.28 14:07:52 [org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:346) ] java.lang.NullPointerException at java.util.Hashtable.put(Unknown Source) at java.util.Properties.setProperty(Unknown Source) at org.jivesoftware.database.DefaultConnectionProvider.start(DefaultConnectionProvider.java:92) at org.jivesoftware.database.DbConnectionManager.setConnectionProvider(DbConnectionManager.java:490) at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:85) at org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:335) at org.jivesoftware.util.JiveProperties.init(JiveProperties.java:73) at org.jivesoftware.util.JiveProperties$JivePropertyHolder.(JiveProperties.java:40) at org.jivesoftware.util.JiveProperties.getInstance(JiveProperties.java:52) at org.jivesoftware.util.JiveGlobals.getProperty(JiveGlobals.java:532) at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:298) at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:415) at org.jivesoftware.openfire.XMPPServer.(XMPPServer.java:161) 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:106) at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:51) 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$1.run(Unknown Source) 2009.12.28 14:07:53 [org.jivesoftware.util.JiveProperties.insertProperty(JiveProperties.java:280) ] java.sql.SQLException: Violation of PRIMARY KEY constraint 'ofProperty_pk'. Cannot insert duplicate key in object 'dbo.ofProperty'. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631) at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546) at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:505) 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 org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100) at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57) at $java.sql.Statement$$EnhancerByProxool$$e7e19a73.executeUpdate() at org.jivesoftware.util.JiveProperties.insertProperty(JiveProperties.java:277) at org.jivesoftware.util.JiveProperties.put(JiveProperties.java:219) at org.jivesoftware.util.JiveGlobals.setProperty(JiveGlobals.java:699) at org.jivesoftware.openfire.SessionManager.initialize(SessionManager.java:1251) at org.jivesoftware.openfire.XMPPServer.initModules(XMPPServer.java:544) at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:432) at org.jivesoftware.openfire.XMPPServer.(XMPPServer.java:161) 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:106) at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:51) 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$1.run(Unknown Source) 2009.12.28 14:08:29 [org.jivesoftware.util.JiveProperties.insertProperty(JiveProperties.java:280) ] java.sql.SQLException: Violation of PRIMARY KEY constraint 'ofProperty_pk'. Cannot insert duplicate key in object 'dbo.ofProperty'. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631) at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546) at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:505) 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 org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100) at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57) at $java.sql.Statement$$EnhancerByProxool$$e7e19a73.executeUpdate() at org.jivesoftware.util.JiveProperties.insertProperty(JiveProperties.java:277) at org.jivesoftware.util.JiveProperties.put(JiveProperties.java:219) at org.jivesoftware.util.JiveGlobals.setProperty(JiveGlobals.java:699) at org.jivesoftware.openfire.update.UpdateManager$1.run(UpdateManager.java:121)

info.log

2009.12.28 14:07:52 Unable to get a connection from the database pool (attempt 1 out of 10). java.sql.SQLException: I/O Error: SSO Failed: SSPI Not Initialized at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:614) at net.sourceforge.jtds.jdbc.ConnectionJDBC2.(ConnectionJDBC2.java:344) at net.sourceforge.jtds.jdbc.ConnectionJDBC3.(ConnectionJDBC3.java:50) at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at org.logicalcobwebs.proxool.DefaultConnectionBuilder.buildConnection(DefaultConnectionBuilder.java:39) at org.logicalcobwebs.proxool.Prototyper.buildConnection(Prototyper.java:159) at org.logicalcobwebs.proxool.ConnectionPool.getConnection(ConnectionPool.java:211) at org.logicalcobwebs.proxool.ProxoolDriver.connect(ProxoolDriver.java:89) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at org.jivesoftware.database.DefaultConnectionProvider.getConnection(DefaultConnectionProvider.java:75) at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:104) at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:698) at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:427) at org.jivesoftware.openfire.XMPPServer.(XMPPServer.java:161) 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:106) at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:51) 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$1.run(Unknown Source) Caused by: java.io.IOException: SSO Failed: SSPI Not Initialized at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1889) at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:587) ... 30 more

I am not clear on what db authentication you are using for the openfire db. is it windows credentials or sql credentials. did you create a sql user and grant them full rights to the openfire db. are the proper rights granted to the openfire.xml so that the user you sign in as can save changes to that file. is there only one instance of openfire running (check taskmanger). the service and the gui app cannot be run simultaneously. is the server firewall configure to allow the server to pass data correctly.

this appears to be a rights issue.

I am using Windows Authentication credentials (I replaced the necessary files per http://www.igniterealtime.org/community/message/158705#158705 )

As I said everything works fine until I restart the server.

use sql authentication. may work better.

Changing to SQL Auth fixes the restart problem (I tried restarting twice and it seems to be working).

I am wondering what the root cause is and is we can file a bug report about this.

One interesting thing is that it certainly can log in to the database at some point, since otherwise I would not be getting “Violation of PRIMARY KEY constraint ‘ofProperty_pk’. Cannot insert duplicate key in object ‘dbo.ofProperty’.” in the log. So when is it working and when is it not working?


Considering that I had to enable Mixed Mode authentication specifically for this (our SQL policy does not generally allow it), I would like to find a solution that will allow me to turn this off.

have you just tried logging out of windows not a restart? I wonder if this would trigger the same thing. could be the way the java connector gathers windows credentials.

I think it is any time the service stops.

I have the service logging in as a particluar user (as opposed to NETWORK SERVICE) and I granted that user Full Control permissions on everything assosiated with openfire (including the database, and “C:\Program Files (x86)\Openfire”)