I have successfully configured sonar server(5.1.2) runs on Windows with MSSQL. In the sonarQube configuration file soar.properties, I only use
sonar.jdbc.url=jdbc:jtds:sqlserver://localhost/sonar;instance=MM02;user=sonar;password=sonar;SelectMethod=Cursor
and in runner folder sonar-runner-2.4, the sonar-runner.properties has
sonar.jdbc.url=jdbc:jtds:sqlserver://localhost/sonar;instance=MM02;SelectMethod=Cursor
The other connection strings are all commented out. There is no connection string in my sonar-project.properties file.
However, when I start the runner in the CL, I keep getting error "Cannot load JDBC driver class 'org.h2.Driver'.
Stack trace is as following:
15:40:33.052 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1.185s
Final Memory: 8M/123M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher
.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102
)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.IllegalStateException: Fail to connect to database
at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java
:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(
ReflectionLifecycleStrategy.java:110)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(Reflect
ionLifecycleStrategy.java:89)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter
.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.j
ava:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Store
d.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(Defaul
tPicoContainer.java:1015)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoConta
iner.java:1008)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.jav
a:766)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentCo
ntainer.java:91)
at org.sonar.batch.bootstrapper.Batch.start(Batch.java:81)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java
:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher
.java:87)
... 9 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver c
lass 'org.h2.Driver'
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(Basic
DataSource.java:1429)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:1371)
at org.apache.commons.dbcp.BasicDataSource.getLogWriter(BasicDataSource.
java:1098)
at org.apache.commons.dbcp.BasicDataSourceFactory.createDataSource(Basic
DataSourceFactory.java:350)
at org.sonar.core.persistence.DefaultDatabase.initDatasource(DefaultData
base.java:103)
at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java
:72)
... 31 more
Caused by: java.lang.ClassNotFoundException: org.h2.Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(Basic
DataSource.java:1420)
... 36 more
Any idea why this runner loads h2 driver in spite that the configuration indicates that MSSQL is the DB?