Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Sonar
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false|title=Table of Contents" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZXx0aXRsZT1UYWJsZSBvZiBDb250ZW50c30&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e3RvY30&locale=en_GB&version=2" data-macro-name="toc"></td></tr></table><h1>Installation</h1><h5>Connect to the wrong Oracle schema</h5><p>When having 2 Sonar schemas on the same Oracle instance, especially if they are in 2 different versions, Sonar can get confused and picks the first it finds. In that case, there are two known workarounds:<br /> 1. Remove the DBA rights to the Sonar users in Oracle<br /> 2. Use sonar.hibernate.default_schema in sonar.properties to set the schema. In that case, -Dsonar.hibernate.default_schema should be used as well during project analysis.</p><h5>Cannot connect to MySQL database</h5><p>By default, remote access to MySQL database server is disabled for security reasons. If you want to remotely access to the database server from the Sonar Maven plugin, you need to follow this <a href="http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html">quick guide</a>.</p><h5>Failed to start on 64-bit Windows 7</h5><p>If you have installed a 64-bit version of the JDK or JRE, and Windows is using the 64-bit version by default, then the batch file windows-x86-32\StartSonar.bat will not start the server because the wrapper.exe program called by the batch file cannot load the lib\wrapper.dll library. You can check which version of Java is being used by opening a shell and typing "java -version". If it is a 64-bit version you will see something like "Java HotSpot (TM) 64-Bit Server VM" in the description. You can download a 32-bit version of the JDK or JRE from Oracle and install it. By default it will be installed under C:\Program Files (x86)\Java. Open up a command shell and change to the top-level directory of drive. With "dir /X" you can list the shortened names of the directories. You want the shortened name of the C:\Program Files (x86) directory, or wherever the 32-bit version of the JDK or JRE was installed. You can then add some lines like the following to the StartSonar.bat batch file to put the directory containing the 32-bit version of java.exe in the beginning of the PATH:</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>rem rem Force the use of a 32-bit JDK because the file lib\wrapper.dll rem will not load with the 64-bit version which the 64-bit OS uses rem be default. rem PATH C:\PROGRA~2\Java\jdk1.6.0_23\bin;%PATH% java -version </pre></td></tr></table><h5>Failed to start on Windows Vista</h5><p>Sonar seems unable to start when installed under the folder "Program Files" in VISTA. It should therefore not be installed there.</p><h5>Failed to launch the Sonar service on Windows platform with a LocalSystem account</h5><p>This error happens when the temporary file path specified for the Local System doesn't exist. Assuming that environment variables have their default settings and that Windows is installed on the ‘C’ drive, the following paths should exist:</p><p>Windows Server 2003, Windows XP : C:\Windows\system32\config\systemprofile\Local Settings\Temp<br /> Windows Server 2008, Windows 7, Windows Vista: C:\Windows\system32\config\systemprofile\AppData\Local\Temp</p><p>In most cases, the "Temp" folder is missing and should be created. See <a href="http://jira.codehaus.org/browse/SONAR-2660">SONAR-2660</a>.</p><h5>Failed to start Sonar with Oracle due to bad USERS table structure</h5><p>When another(s) USERS table exists in the Oracle DB, if the sonar user has read access on this other USERS table, the Sonar web server can't start and an exception like the following one is thrown :</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>ActiveRecord::ActiveRecordError: ORA-00904: "TOTO": invalid identifier : INSERT INTO users (login, name, email, crypted_password, salt, created_at, updated_at, remember_token, remember_token_expires_at, toto, id) VALUES('admin', 'Administrator', '', 'bba4c8a0f808f9798cf8b1c153a4bb4f9178cf59', '2519754f77ea67e5d7211cd1414698f465aacebb', TIMESTAMP'2011-06-24 22:09:14', TIMESTAMP'2011-06-24 22:09:14', null, null, null, ?) ActiveRecord::ActiveRecordError: ORA-00904: "TOTO": invalid identifier : INSERT INTO users (login, name, email, crypted_password, salt, created_at, updated_at, remember_token, remember_token_expires_at, toto, id) VALUES('admin', 'Administrator', '', 'bba4c8a0f808f9798cf8b1c153a4bb4f9178cf59', '2519754f77ea67e5d7211cd1414698f465aacebb', TIMESTAMP'2011-06-24 22:09:14', TIMESTAMP'2011-06-24 22:09:14', null, null, null, ?) </pre></td></tr></table><p>See <a href="https://jira.codehaus.org/browse/SONAR-2549">SONAR-2549</a>.<br /> To fix this issue, the rights of the sonar oracle user must be decreased to remove read access on the other(s) USERS table(s).</p><h5>Failed to connect to update center via proxy</h5><p>Double-check that settings for proxy in file <code>sonar.properties</code> are specified correctly.<br /> Note that if your username contains "\" (backslash), then it should be escaped - for example username "domain\user" in file should look like:</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>http.proxyUser=domain\\user </pre></td></tr></table><p>For some proxies exception "java.net.ProtocolException: Server redirected too many times" might mean incorrect username or password.</p><h5>Can Sonar run in HTTPS mode</h5><p>No. But you can run Sonar in a standard HTTPS infrastructure using reverse proxy (in this case the reverse proxy must be configured to set the value '<span style="color: rgb(0,0,0);">X_FORWARDED_PROTO: https</span>' in each HTTP request header. Without this property, redirection initiated by the Sonar server will fall back on HTTP).</p><h5>Solaris: Issue with JRuby 1.6.6 / 1.6.7</h5><p><strong>Standalone:</strong></p><p>Due to the following JRuby issue: <a class="external-link" href="https://jira.codehaus.org/browse/JRUBY-6494" rel="nofollow">https://jira.codehaus.org/browse/JRUBY-6494</a>, the following line has to be added in conf/wrapper.conf:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="language=none" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9bm9uZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>wrapper.java.additional.3=-Djruby.native.enabled=false</pre></td></tr></table><p>See <a href="http://jira.codehaus.org/browse/SONAR-4046">SONAR-4046</a> for more information.</p><p><strong>Tomcat:</strong></p><p>Note that this property has to be set when launching Tomcat (as the wrapper.conf file is not used when deploying in application server).</p><h1>Analysis</h1><h5>INVALID HASH</h5><p>While running an analysis, you may face the following error:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="language=none" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9bm9uZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>12:20:22.426 INFO - Install plugins 12:20:22.426 DEBUG - Download index of plugins 12:20:22.426 DEBUG - Download: http://localhost:9000/deploy/plugins/index.txt (no proxy) 12:20:23.019 DEBUG - Download /deploy/plugins/xxx/sonar-xxx-plugin-X.Y.jar to C:\Documents and Settings\myUser\.sonar\cache\_tmp\1369156823019-681 ... ... INFO: EXECUTION FAILURE ... ... ERROR: Error during Sonar runner execution org.sonar.runner.impl.RunnerException: Unable to execute Sonar ... ... Caused by: java.lang.IllegalStateException: INVALID HASH: File C:\Documents and Settings\myUser\.sonar\cache\_tmp\1369156823019-681 was expected to have hash bc7b831dce659cbfa238c0d6f961409b but was downloaded with hash d41d8cd98f00b204e9800998ecf8427e ... </pre></td></tr></table><p>It means that the analyzer encountered an issue while downloading the plugins from the Sonar server to the machine running the project analysis.</p><p>This error could be due either to:</p><ul><li>A connection issue with the Sonar server. Check with your network administrator.</li><li>A user quota issue. Indeed, by default, all the plugins are downloaded to the local space of the user running the analysis. Some companies set restrictions in terms of local user space, hence the issue. The workaround is to set the 'SONAR_USER_HOME' environment variable on the machine running the analysis to a directory with enough available space to download all the plugins. </li></ul><h1>Security</h1><h5>I have locked myself out</h5><p>There is currently nothing that stops you removing from every user and every group the global administrator role. the global administrator role. You then have no other solution than make an manual update in the Sonar database to get back in control.</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>INSERT INTO user_roles(user_id, role) VALUES ((select id from users where login='mylogin'), 'admin'); </pre></td></tr></table><h5>I lost the admin password</h5><p>In case you lost the admin password of your Sonar instance, you can reset it by running the following update statement :</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>update users set crypted_password = '88c991e39bb88b94178123a849606905ebf440f5', salt='6522f3c5007ae910ad690bb1bdbf264a34884c6d' where login = 'admin' </pre></td></tr></table><p>This will reset the password to admin.</p><h1>General</h1><h5>Failed to analyse a project as another analysis on the same project seems to be running at the same time (Sonar 3.4 only)</h5><p>In Sonar 3.4 (<a href="http://jira.codehaus.org/browse/SONAR-3306">SONAR-3306</a>) a new semaphore mechanism has been introduced to prevent launching several analysis on the same project in parallel. But in some cases when an analysis of a project is unexpectedly interrupted, the lock of the semaphore is sometimes not released and in such case it's up to the Sonar administrator to relaunch the project analysis with the property 'sonar.forceAnalysis=true'. This limitation has been fixed in Sonar 3.5 (<a href="http://jira.codehaus.org/browse/SONAR-4053">SONAR-4053</a>). </p><h5>How to remove false-positive violations?</h5><h6>NOSONAR</h6><p>You can use the mechanism embedded in underlying rules violation engine (//NOPMD...) or the generic mechanism implemented in Sonar : Put //NOSONAR at the end of the line of the violation. This will suppress the violation.</p><h6>SuppressWarnings</h6><p>The //NOSONAR tag is useful to deactivate all rules at a given line but is not suitable to deactivate all rules (or only a given rule) for all the lines of a method or a class. This is why support for @SuppressWarnings("all") has been added to Sonar.</p><h6>Use the Switch Off Violations plugin</h6><p><a href="http://docs.codehaus.org/display/SONAR/Switch+Off+Violations+Plugin">http://docs.codehaus.org/display/SONAR/Switch+Off+Violations+Plugin</a></p><h6>Switch off violation</h6><p>You can use the <a class="confluence-link" href="/display/SONAR/Violations+and+Reviews#ViolationsandReviews-Flagasfalse-positive" data-anchor="Flagasfalse-positive" data-linked-resource-id="210173975" data-linked-resource-type="page" data-linked-resource-default-alias="Violations and Reviews#Flagasfalse-positive" data-base-url="http://docs.codehaus.org">Review</a> feature to flag a violation as false-positive directly from the user interface.</p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced