1
votes

When I start Sonar (StartSonar.bat), I get the following error in the log file.

Wrong column type in SONAR.dbo.rules for column description.
Found: ntext, expected: nvarchar(max)

Looking at the column in SQL Server Management Studio it is nvarchar(max)

I'm running:

  • DB: SQL Server 2005
  • OS: Windows 7 64 bit
  • Sonar: 2.11

Tried these drivers:

  • sqljdbc-1.2.2828.100.jar
  • sqljdbc4.jar (Microsoft SQL Server JDBC Driver 2.0)
  • sqljdbc4.jar (Microsoft SQL Server JDBC Driver 3.0)
  • sqljdbc4.jar (Microsoft SQL Server JDBC Driver 4.0)

My MSSQL Properties:

  • sonar.jdbc.url: jdbc:sqlserver://localhost;databaseName=SONAR;
  • sonar.jdbc.driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
  • sonar.jdbc.validationQuery: select 1
  • sonar.jdbc.dialect: mssql

I'm using a user name and password (SQL Authentication) to connect the DB

Note to self: When trying to connect to MSSQL remember to Enable TCP/IP. This is found in the SQL Sever Configuration Manager;SQL Server 2005 Network Configuration;Protocols for MSSQLSERVER;TCP/IP

I thought it might be a driver issue, but I'm not sure

Anyone else seen this?

1

1 Answers

3
votes

I wasn't able to solve this via the sqljdbc drivers so I took some advise from another post and fell back to the jTDS driver http://jtds.sourceforge.net/index.html

The post I used was Sonar MsSql Database Issue

My Setup:

  • Sonar 2.11 unzipped to C:\Sonar\sonar-2.11

The steps I made (paraphrased)

  1. Download jTDS drivers from jTDS Drivers Unzip it somewhere, I suggest C:\jDST
  2. Add the DLL to the system path. (C:\jDST\jtds-1.2.5-dist\x64\SSO)
  3. Copy the jar file (C:\jDST\jtds-1.2.5-dist\jtds-1.2.5.jar) to the extensions folder (C:\Sonar\sonar-2.11\extensions\jdbc-driver\mssql)
  4. Update the sonar.properties

    • sonar.jdbc.url: jdbc:jtds:sqlserver://localhost:1433/SONAR
    • sonar.jdbc.driverClassName: net.sourceforge.jtds.jdbc.Driver
    • sonar.jdbc.validationQuery: select 1
    • sonar.jdbc.dialect: mssql

Note: in case you connect to the named instance, this must be specified explicitly in the connection URL: jdbc:jtds:sqlserver://localhost/SONAR;instance=SQLEXPRESS

Run the bat file StartSonar.bat (C:\Sonar\sonar-2.11\bin\windows-x86-64\StartSonar.bat)

Check your logs and go to the site http:// localhost:9000