Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Sonar widget error with lastest master branch code #1462

Closed
kavitha0624 opened this issue Jun 8, 2017 · 4 comments
Closed

Sonar widget error with lastest master branch code #1462

kavitha0624 opened this issue Jun 8, 2017 · 4 comments

Comments

@kavitha0624
Copy link

Hi Team,

I have recently downloaded the latest code from Master and trying to setup in my local.
When I am running the sonar collector and finding the bellow nullpointer. Please help.

[taskScheduler-1] INFO com.capitalone.dashboard.collector.CollectorTask - Running Collector: Sonar
[taskScheduler-1] ERROR org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task.
java.lang.NullPointerException
at java.util.ArrayList.addAll(Unknown Source)
at com.capitalone.dashboard.model.SonarCollector.prototype(SonarCollector.java:29)
at com.capitalone.dashboard.collector.SonarCollectorTask.getCollector(SonarCollectorTask.java:57)
at com.capitalone.dashboard.collector.SonarCollectorTask.getCollector(SonarCollectorTask.java:26)
at com.capitalone.dashboard.collector.CollectorTask.run(CollectorTask.java:48)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Below is the properties file content

dbname=dashboardfive
dbusername=dashboarduser
dbpassword=dbpassword
dbhost=localhost
dbport=27017
dbreplicaset=false
dbhostport=localhost:27017
server.contextPath=/api
server.port=8080
SONAR_CRON=0 * * * * *
sonar.servers[0]=https://sonarqube.xxx.com:8443
sonar.key=ojvBRi/EFhPNKc1GmNBbGVeF3Df0x4XO
#sonar.metrics=ncloc,code_coverage,rules,line_coverage,violations,critical_violations,major_violations,blocker_violations,sqale_index,test_success_density,test_failures,test_errors,tests
sonar.metrics=ncloc,code_coverage,rules,line_coverage,violations,critical_violations,major_violations,blocker_violations,sqale_index,test_success_density,test_failures,test_errors

@satishc1
Copy link
Collaborator

satishc1 commented Jun 8, 2017

@kavitha0624 Paste the command you are using to start the sonar collector. Also take out the following 3 lines from your sonar prop file.

server.contextPath=/api
server.port=8080
sonar.key

And comment out this line

#dbhostport=localhost:27017

@kavitha0624
Copy link
Author

@satishc1 - I have done the above but the it still throws the same error.

I am starting Sonar collector with the below command. I have used the same command for other versions of Hygieia. Running this in the target folder.
java -jar sonar-codequality-collector-2.0.5-SNAPSHOT.jar --spring.config.location=application.properties

@nireeshT
Copy link
Collaborator

nireeshT commented Jun 12, 2017

@kavitha0624 add below line in your properties file.

sonar.versions[0]=what ever sonar version , mine is 5.9

@kavitha0624
Copy link
Author

@nireeshT , thank you. It's working now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants