Using the latest version of SQL Server JDBC Driver (v8.0 and upwards) gives an error

Template for a good bug report, formatted with Markdown:

  • Versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    Latest version of SonarQube: Version 8.5 (build 37579)
  • Error observed (wrap logs/code around triple quote ``` for proper formatting)
2020.11.13 18:25:14 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:sqlserver://dtw01etsdb01c\dt01ets02;databaseName=Sonar;integratedSecurity=true
2020.11.13 18:25:29 ERROR web[][o.s.s.p.PlatformImpl] Web server startup failed
java.lang.IllegalStateException: Fail to connect to database
	at org.sonar.db.DefaultDatabase.start(
	at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(
	at org.picocontainer.behaviors.AbstractBehavior.start(
	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(
	at org.picocontainer.behaviors.Stored.start(
	at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(
	at org.picocontainer.DefaultPicoContainer.startAdapters(
	at org.picocontainer.DefaultPicoContainer.start(
	at org.sonar.core.platform.ComponentContainer.startComponents(
	at org.sonar.server.platform.platformlevel.PlatformLevel.start(
	at org.sonar.server.platform.platformlevel.PlatformLevel1.start(
	at org.sonar.server.platform.PlatformImpl.start(
	at org.sonar.server.platform.PlatformImpl.startLevel1Container(
	at org.sonar.server.platform.PlatformImpl.init(
	at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(
	at org.apache.catalina.core.StandardContext.listenerStart(
	at org.apache.catalina.core.StandardContext.startInternal(
	at org.apache.catalina.util.LifecycleBase.start(
	at org.apache.catalina.core.ContainerBase$
	at org.apache.catalina.core.ContainerBase$
	at java.base/
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.base/java.util.concurrent.ThreadPoolExecutor$
	at java.base/
Caused by: java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
	at org.sonar.db.DefaultDatabase.checkConnection(
	at org.sonar.db.DefaultDatabase.start(
	... 24 common frames omitted
Caused by: java.sql.SQLException: Cannot create PoolableConnectionFactory (This driver is not configured for integrated authentication. ClientConnectionId:b25351cc-a0a4-47f4-bad4-d162a8bb5f0c)
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(
	at org.apache.commons.dbcp2.BasicDataSource.createDataSource(
	at org.apache.commons.dbcp2.BasicDataSource.getConnection(
	at org.sonar.db.profiling.NullConnectionInterceptor.getConnection(
	at org.sonar.db.profiling.ProfiledDataSource.getConnection(
	at org.sonar.db.DefaultDatabase.checkConnection(
	... 25 common frames omitted
Caused by: This driver is not configured for integrated authentication. ClientConnectionId:b25351cc-a0a4-47f4-bad4-d162a8bb5f0c
	at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(
	at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(
	at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(
	... 30 common frames omitted
Caused by: java.lang.UnsatisfiedLinkError: no sqljdbc_auth in java.library.path: [C:\Program Files\Java\openjdk-11.0.8_10\bin, C:\Windows\Sun\Java\bin, C:\Windows\system32, C:\Windows, C:\Windows\system32, C:\Windows, C:\Windows\System32\Wbem, C:\Windows\System32\WindowsPowerShell\v1.0\, C:\Windows\System32\OpenSSH\, C:\Program Files\Puppet Labs\Puppet\bin, c:\Program Files\Venafi\Agent\Libs, C:\Program Files\Java\openjdk-11.0.8_10\bin, C:\Users\a952856-a\AppData\Local\Microsoft\WindowsApps, .]
	at java.base/java.lang.ClassLoader.loadLibrary(
	at java.base/java.lang.Runtime.loadLibrary0(
	at java.base/java.lang.System.loadLibrary(
	... 42 common frames omitted

I was installing a new instance of SonarQube on Windows Server 2019 and using a separate server that contains SQL Server 2016 as the holding database. This is sitting on a Windows 2012 R2 server OS.
The steps to reproduce this is:

  • Setup your SQL Server database as stipulated in the SonarQube documentation
  • Setup Java on your App server as per the SonarQube install documentation
  • Setup SonarQube as per the SonarQube install documentation
  • Setup the SQL Server JDBC Driver as per the SonarQube install documentation
  • Configure SonarQube via the properties file, as per the SonarQube install documentation
  • Run StartSonar.bat
  • You will get a failure to start the Web Service and in the logs the above error will be displayed.

After much pulling my hair out, it turns out the the SQL Server JDBC Driver has been renamed from sqljdbc_auth.dll to mssql-jdbc_auth-8.4.1.x64.dll as of v8.2. Once I replaced the v8.4 driver that I had installed with v7.4 this version of the driver was found and the web server was able to start up. Not sure if I should not be using v8.4 or v8.2 of the driver, but based on the matrix given by Microsoft, found here:
It did not seem to indicate I should not be using it. Therefore I assume the latest version was backward compatible and okay to use. So not sure if it is the “Wrapper” that is needing to use sqjjdbc_auth or SonarQube. But either way it is failing due to the name change. By going back to v7.4 of the driver I was able to solve the problem.

Hey there.

The version of the JDBC driver shipped with your version of SonarQube cannot be upgraded at will – the version packaged is the version that should be used. What triggered trying to upgrade it?