2

I am using SonarQube for code analysis. I am trying to have Sonar connect to Oracle DB. I am getting this error - Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener org.sonar.api.utils.MessageException: Oracle must be have UTF8 charset and BINARY sort. NLS_CHARACTERSET is WE8MSWIN1252 and NLS_SORT is BINARY. Is there any way to have Sonar use Oracle charset other than UTF8?

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
DTnapaT
  • 319
  • 1
  • 4
  • 16

1 Answers1

5

No, UTF8 character set is required since SonarQube 5.5. See https://jira.sonarsource.com/browse/SONAR-6171.

Simon Brandhof
  • 5,137
  • 1
  • 21
  • 28
  • Thanks for your reply. All oracle installations in my current company use NLS_CHARACTERSET as WE8MSWIN1252. So I am thinking of using sonar with postgresql. – DTnapaT Jul 27 '16 at 02:58
  • The UTF8 character set is outdated. The [Oracle charset documentation](https://docs.oracle.com/database/121/NLSPG/ch2charset.htm#NLSPG172) states that _Oracle recommends for all new system deployment ... the Unicode character set AL32UTF8_. Therefore SonarQube should allow at least AL32UTF8 as well as UTF8. As the charset is not defined per schema but per database, this seems to be an issues that should be fixed in the LTS version. Otherwise users are forced to setup a single database with the outdated charset only for Sonarqube. – Philip Jan 02 '17 at 09:38
  • @Philip AL32UTF8 is supposed to be already supported by SonarQube. Do you face issues with it ? – Simon Brandhof Jan 03 '17 at 08:33
  • @SimonBrandhof-SonarSource, thanks for your answer. We had NLS_CHARACTERSET = AL32UTF8 and NLS_SORT = GERMAN configured. Due to the error message we were expecting that we have to change both parameters (NLS_CHARACTERSET to UTF8 and NLS_SORT to BINARY). Now after your comment we've tested the combination NLS_CHARACTERSET = AL32UTF8 and NLS_SORT to BINARY. Now it works. Still we wonder why SonarQube requires an NLS_SORT = BINARY on database level. This could be set by SonarQube via an ALTER SESSION command. To require a specific NLS_SORT on database level seems too restrictive. – Philip Jan 04 '17 at 12:00
  • @Philip thanks for the feedback. The requirement on NLS_SORT will be dropped in version 6.3: https://jira.sonarsource.com/browse/SONAR-8585 – Simon Brandhof Jan 04 '17 at 20:32