SonarLint for Eclipse throws errors on updating server issues

Hi,

since the SonarLint update to 7.30 we’re getting errors during file analysis. From the SonarLint console:

Error while fetching and matching server issues
java.lang.NoClassDefFoundError: org/eclipse/jgit/util/StringUtils
	at org.sonarlint.eclipse.core.internal.vcs.VcsService.lambda$0(VcsService.java:106)
	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
	at org.sonarlint.eclipse.core.internal.vcs.VcsService.electBestMatchingBranch(VcsService.java:103)
	at org.sonarlint.eclipse.core.internal.vcs.VcsService.getServerBranch(VcsService.java:125)
	at org.sonarlint.eclipse.core.internal.tracking.ServerIssueUpdater$IssueUpdateJob.run(ServerIssueUpdater.java:98)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jgit.util.StringUtils cannot be found by org.sonarlint.eclipse.core_7.3.0.44160
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:519)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 6 more

I’ve noticed that the log output is rather new and that JGit is listed as optional dependency in the projects Manifest file.

Versions used:
Eclipse: 2021-03 (4.19)
SonarLint: 7.3.0
SonarQube: 8.9.5

Oliver

Hi @oliver

Thanks for the feedback, this is a bug. For our information, what is the package of Eclipse you are using? I’m curious because I though those days all official Eclipse packages would contain eGit.

Anyway here is the ticket, we will publish a bugfix release soon:
https://jira.sonarsource.com/browse/SLE-513

Hi @Julien_HENRY,

thanks for the quick reply and the quick fix. Indeed, you are right, Eclipse does come with EGit bundled. However, we use a custom Eclipse package which does not bundle EGit. So we have partly ourselves to blame :wink:

Definitely not. This was in our goals to support this use case, and we let this invalid import in the way.

I have release SonarLint for Eclipse 7.3.1 that should fix your issue. Sorry for the inconvenience and thanks again for reporting.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.