SonarQube 5.4后台任务在Java文件上失败并出现NullPointerException

时间:2016-06-28 21:13:46

标签: java sonarqube sonarqube-ops sonarqube-5.4

我使用SonarQube 5.4(在Linux x86_64上以JRE 1.8.0_77运行)来分析Java项目。最近我开始收到这个错误...任何有关如何解决它的帮助都是最受欢迎的。谢谢!

2016.06.28 16:48:48 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVWYxWzSMfmN2jNceiJu
org.sonar.server.computation.component.VisitException: Visit of Component {key=IAR:src/java/gov/nih/era/iar/meetingannouncement/domain/MeetingAnnouncement.java,type=FILE} failed
    at org.sonar.server.computation.component.VisitException.rethrowOrWrap(VisitException.java:44) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:64) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:100) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:87) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:62) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:100) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:87) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:62) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.step.ExecuteVisitorsStep.execute(ExecuteVisitorsStep.java:50) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:39) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:72) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:80) [sonar-server-5.4.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:55) [sonar-server-5.4.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:34) [sonar-server-5.4.jar:na]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_77]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_77]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_77]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_77]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_77]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_77]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_77]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_77]
Caused by: java.lang.IllegalStateException: Fail to process issues of component 'IAR:src/java/gov/nih/era/iar/meetingannouncement/domain/MeetingAnnouncement.java'
    at org.sonar.server.computation.issue.IntegrateIssuesVisitor.processIssues(IntegrateIssuesVisitor.java:74) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:59) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.component.TypeAwareVisitorWrapper.visitAny(TypeAwareVisitorWrapper.java:82) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitNode(VisitorsCrawler.java:107) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:90) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:62) ~[sonar-server-5.4.jar:na]
    ... 20 common frames omitted
Caused by: java.lang.NullPointerException: null
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:213) ~[guava-17.0.jar:na]
    at com.google.common.base.Splitter.splitToList(Splitter.java:416) ~[guava-17.0.jar:na]
    at org.sonar.db.source.FileSourceDao.selectLineHashes(FileSourceDao.java:73) ~[sonar-db-5.4.jar:na]
    at org.sonar.server.computation.issue.TrackerBaseInputFactory$BaseLazyInput.loadLineHashSequence(TrackerBaseInputFactory.java:66) ~[sonar-server-5.4.jar:na]
    at org.sonar.core.issue.tracking.LazyInput.getLineHashSequence(LazyInput.java:34) ~[sonar-core-5.4.jar:na]
    at org.sonar.core.issue.tracking.LazyInput.getBlockHashSequence(LazyInput.java:42) ~[sonar-core-5.4.jar:na]
    at org.sonar.core.issue.tracking.BlockRecognizer.match(BlockRecognizer.java:40) ~[sonar-core-5.4.jar:na]
    at org.sonar.core.issue.tracking.Tracker.detectCodeMoves(Tracker.java:69) ~[sonar-core-5.4.jar:na]
    at org.sonar.core.issue.tracking.Tracker.track(Tracker.java:52) ~[sonar-core-5.4.jar:na]
    at org.sonar.server.computation.issue.TrackerExecution.track(TrackerExecution.java:41) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.issue.IntegrateIssuesVisitor.processIssues(IntegrateIssuesVisitor.java:67) ~[sonar-server-5.4.jar:na]
    ... 25 common frames omitted
2016.06.28 16:48:49 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Executed task | project=IAR | id=AVWYxWzSMfmN2jNceiJu | time=5005ms

1 个答案:

答案 0 :(得分:0)

更改sonar-java-plugin的版本。 我们在SonarQube版本5.6.4, org.sonarsource.java:sonar-java-plugin:4.4.0.8066 中遇到了同样的问题。将sonar-java-plugin的版本更改为 3.13.1 解决了这个问题。