Exception thrown when running SonarLint on WebStorm with latest version (5.0.0.33494)

Template for a good bug report, formatted with Markdown:

  • sonarlint intellij plugin5.0.0.33494
  • WebStorm 2020.3
  • when opening a WebStorm or scanning a file, it throws an exception:
Using storage for connection 'SQ' (last update 2021-06-17, 6:11 p.m.)
Creating container for module with key=Module: 'my-web'
Server started on 64120
Using connection 'SQ' for project 'com.jlee:my-proj'
Analysing 'CaseFoldersSpec.js'...
Error running SonarLint analysis
java.lang.NoClassDefFoundError: org/apache/commons/io/IOUtils
	at org.sonarlint.intellij.analysis.DefaultClientInputFile.contents(DefaultClientInputFile.java:105)
	at org.sonarsource.sonarlint.core.container.analysis.filesystem.SonarLintInputFile.contents(SonarLintInputFile.java:137)
	at org.sonar.javascript.visitors.JavaScriptFileImpl.contents(JavaScriptFileImpl.java:42)
	at org.sonar.javascript.checks.utils.CheckUtils.newBufferedReader(CheckUtils.java:143)
	at org.sonar.javascript.checks.utils.CheckUtils.readLines(CheckUtils.java:134)
	at org.sonar.plugins.javascript.minify.AverageLineLengthCalculator.getAverageLineLength(AverageLineLengthCalculator.java:53)
	at org.sonar.plugins.javascript.minify.MinificationAssessor.hasExcessiveAverageLineLength(MinificationAssessor.java:66)
	at org.sonar.plugins.javascript.minify.MinificationAssessor.isMinified(MinificationAssessor.java:53)
	at org.sonar.plugins.javascript.JavaScriptExclusionsFileFilter.accept(JavaScriptExclusionsFileFilter.java:97)
	at org.sonarsource.sonarlint.core.container.analysis.filesystem.FileIndexer.accept(FileIndexer.java:115)
	at org.sonarsource.sonarlint.core.container.analysis.filesystem.FileIndexer.indexFile(FileIndexer.java:100)
	at org.sonarsource.sonarlint.core.container.analysis.filesystem.FileIndexer.indexFiles(FileIndexer.java:94)
	at org.sonarsource.sonarlint.core.container.analysis.filesystem.FileIndexer.index(FileIndexer.java:78)
	at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:132)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:126)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:111)
	at org.sonarsource.sonarlint.core.container.storage.StorageAnalyzer.analyze(StorageAnalyzer.java:75)
	at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.analyze(StorageContainerHandler.java:83)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(ConnectedSonarLintEngineImpl.java:148)
	at org.sonarsource.sonarlint.core.AbstractSonarLintEngine.withModule(AbstractSonarLintEngine.java:86)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$1(ConnectedSonarLintEngineImpl.java:146)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:336)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:326)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:144)
	at org.sonarlint.intellij.core.ConnectedSonarLintFacade.analyze(ConnectedSonarLintFacade.java:74)
	at org.sonarlint.intellij.core.SonarLintFacade.startAnalysis(SonarLintFacade.java:65)
	at org.sonarlint.intellij.analysis.SonarLintAnalyzer.analyzeModule(SonarLintAnalyzer.java:89)
	at org.sonarlint.intellij.analysis.SonarLintTask.analyzePerModule(SonarLintTask.java:351)
	at org.sonarlint.intellij.analysis.SonarLintTask.run(SonarLintTask.java:139)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:962)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:472)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:235)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:235)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.IOUtils PluginClassLoader[PluginDescriptor(name=SonarLint, id=org.sonarlint.idea, path=/Users/jlee/Library/Application Support/JetBrains/WebStorm2020.3/plugins/sonarlint-intellij, version=5.0.0.33494)] com.intellij.ide.plugins.cl.PluginClassLoader@2048935a
	at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:129)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 46 more
  • Steps to Reproduce: Open WebStorm and analyze any file using sonarlint plugin
  • Workaround: none

Note: sonarlint used to work fine before I updated the sonarlint plugin to 5.0.0.33494 yesterday.

Upgrading WebStorm to 2021.1.2 fixed the issue.

Hello, thanks for the feedback and also for the workaround!

I will try to reproduce with WS 2020.3, it’s definitely not expected that you get this exception - SonarLint is supposed to support up to 2019.3

Hello again,

For your information, we just published version 5.0.1 which fixes the issue with pre-2021.x versions.

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