Using ntlmauth.dll with JTDS, Openfire 3.6.0a & Windows2008x64

Hi,

I am trying to setup a new Openfire server with version 3.6.0a on Windows 2008 x64. The database is on a remote MS SQL2005 cluster.

Previously on Wildfire 3.1.1, to avoid having a username & password stored in plain text in the config file, we had setup JTDS to use NTLM authentication based on the user running the openfire process. This was done using the JTDS’s ntlmauth.dll.

On the new server however, I cannot get this working without specifying the user details in the config file.

Has anybody got this working?

I’ll post the error logs up tomorrow which may help work out what the issue is.

Thanks

Jason

Here are the logs…

Info.log:

2008.10.17 12:13:15 Unable to get a connection from the database pool (attempt 1 out of 10).
java.sql.SQLException: I/O Error: DB server closed connection. at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2307) at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:609) at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:344) at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(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.<init>(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: DB server closed connection. at net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.java:843) at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:722) at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:466) at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:103) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2202) ... 31 more

Error.log

2008.10.17 12:13:14 [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.<clinit>(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.<init>(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)
2008.10.17 12:13:18 [org.jivesoftware.util.log.util.CommonsLogFactory$1.error(CommonsLogFactory.java:92)
] Prototype
java.sql.SQLException: I/O Error: DB server closed connection. at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2307) at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:609) at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:344) at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(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.Prototyper.sweep(Prototyper.java:102) at org.logicalcobwebs.proxool.PrototyperThread.run(PrototyperThread.java:44)
Caused by: java.io.IOException: DB server closed connection. at net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.java:843) at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:722) at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:466) at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:103) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2202) ... 10 more
2008.10.17 12:13:18 [org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:709)
] 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: I/O Error: DB server closed connection. at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:124) at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:698) at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:427) at org.jivesoftware.openfire.XMPPServer.<init>(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)
2008.10.17 12:13:18 [org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:457)
] 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: I/O Error: DB server closed connection. at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:710) at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:427) at org.jivesoftware.openfire.XMPPServer.<init>(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.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 retries. The exception from the last attempt is as follows: java.sql.SQLException: I/O Error: DB server closed connection. at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:124) at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:698) ... 16 more

Warn.log

2008.10.17 12:13:14 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.<clinit>(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.<init>(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)

Help!

Just noticed the following error on the SQL Server:

Length specified in network packet payload did not match number of bytes read; the connection has been closed. Please contact the vendor of the client library. [CLIENT: ipaddress]

I think the Authentication is actually working, but the connections get closed due to the above error… What would cause this?

Jas