NullPointerException During SonarLint Analysis in Eclipse

eclipse

(Nick McGill) #1

Version Information:
Eclipse Platform 4.6.3
SonarLint Plugin 3.6.0

Error Observed:

Error during execution of SonarLint analysis
java.lang.NullPointerException
	at org.sonarlint.eclipse.core.internal.proto.Sonarlint$Issues$Issue$Builder.setType(Sonarlint.java:1619)
	at org.sonarlint.eclipse.core.internal.tracking.IssueStore.transform(IssueStore.java:119)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at org.sonarlint.eclipse.core.internal.tracking.IssueStore.transform(IssueStore.java:103)
	at org.sonarlint.eclipse.core.internal.tracking.IssueStore.save(IssueStore.java:70)
	at org.sonarlint.eclipse.core.internal.tracking.PersistentIssueTrackerCache$LimitedSizeLinkedHashMap.removeEldestEntry(PersistentIssueTrackerCache.java:59)
	at java.util.LinkedHashMap.afterNodeInsertion(LinkedHashMap.java:299)
	at java.util.HashMap.putVal(HashMap.java:664)
	at java.util.HashMap.put(HashMap.java:612)
	at org.sonarlint.eclipse.core.internal.tracking.PersistentIssueTrackerCache.put(PersistentIssueTrackerCache.java:105)
	at org.sonarlint.eclipse.core.internal.tracking.IssueTracker.updateCache(IssueTracker.java:61)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.trackIssues(AnalyzeProjectJob.java:346)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.updateMarkers(AnalyzeProjectJob.java:303)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.runAnalysisAndUpdateMarkers(AnalyzeProjectJob.java:206)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.doRun(AnalyzeProjectJob.java:160)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarProjectJob.runInWorkspace(AbstractSonarProjectJob.java:43)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

I have no special steps to reproduce. It happens for me whenever I initiate analysis of a project.

No known workaround using the plugin. I can successfully scan using SonarScanner, but I’m trying to leverage the plugin functionality to provide a report at the moment.


(Patrik Jetzer) #2

I’m experiencing the exact same issue after upgrading to SonarQube Server from 7.2 to “Version 7.3 (build 15553)”
I have tested with SonarLint Plugin Version 3.4 & 3.6.


(Galaxy) #3

I have what seems to be the same problem, am using SonarLint Plugin version 4.0 on Atollic TrueStudio 9.2.0 (Eclipse 4.6.1) with SonarQube 7.5.0.20543

Error during execution of SonarLint analysis
java.lang.NullPointerException
	at com.sonar.cpp.N.H.B(na:1388)
	at com.sonar.cpp.N.A.A(na:400)
	at com.sonar.cpp.plugin.R.A(na:2887)
	at com.sonar.cpp.plugin.R.execute(na:156)
	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:81)
	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.execute(SensorsExecutor.java:72)
	at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:132)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:110)
	at org.sonarsource.sonarlint.core.container.storage.StorageAnalyzer.analyze(StorageAnalyzer.java:75)
	at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.analyze(StorageContainerHandler.java:82)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(ConnectedSonarLintEngineImpl.java:152)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:344)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:334)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:149)
	at org.sonarlint.eclipse.core.internal.server.Server.runAnalysis(Server.java:312)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeConnectedProjectJob.runAnalysis(AnalyzeConnectedProjectJob.java:67)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeConnectedProjectJob.runAnalysis(AnalyzeConnectedProjectJob.java:1)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.run(AbstractAnalyzeProjectJob.java:397)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.runAnalysisAndUpdateMarkers(AbstractAnalyzeProjectJob.java:205)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.doRun(AbstractAnalyzeProjectJob.java:167)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarProjectJob.runInWorkspace(AbstractSonarProjectJob.java:44)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

(Galaxy) #4

Issue still exists in new installation of Sonarlint on a different computer. Same project.

Sonarlint version: 4.1.0.201901311043
TrueStudio version: 9.2.0 (Eclipse 4.6.1)
SonarQube: 7.5.0.20543


(Julien Henry) #5

Hi @Galaxy, this is not because a stacktrace start by the same message that this is the same issue. In your case the issue is in our commercial C++ analyzer. Could you please start a new thread, adding the tag ‘cfamily’?

@nmmcgill sorry for missing this thread in the first place. If you still have the issue (or someone else), I need the following information:

  • are you using connected mode?
  • can you try to purge the issue local storage (in <workspace>/.sonarlint/modules/<your project>/issues) and see if the issue come back?
  • if you are using connected mode, what is the SonarQube server version?