添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
  • Operating system: Windows 10
  • SonarLint plugin version: 6.8.0.50884
  • SonarQube: 8.9.1 (build 44547)
  • IntelliJ IDEA: IntelliJ IDEA 2022.1.4 (Community Edition), Build #IC-221 .6008.13, built on July 19, 2022
  • Probably due to the latest IntelliJ IDEA update the plugin doesn’t work anymore:

    Error running SonarLint analysis
    java.lang.IllegalStateException: Unable to load component class org.sonarsource.sonarlint.core.analysis.container.analysis.sensor.SensorsExecutor
    	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:57)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
    	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer.getComponentByType(ComponentContainer.java:249)
    	at org.sonarsource.sonarlint.core.analysis.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:122)
    	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer.startComponents(ComponentContainer.java:119)
    	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer.execute(ComponentContainer.java:104)
    	at org.sonarsource.sonarlint.core.analysis.container.module.ModuleContainer.analyze(ModuleContainer.java:71)
    	at org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand.execute(AnalyzeCommand.java:58)
    	at org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand.execute(AnalyzeCommand.java:32)
    	at org.sonarsource.sonarlint.core.analysis.AnalysisEngine$AsyncCommand.execute(AnalysisEngine.java:152)
    	at org.sonarsource.sonarlint.core.analysis.AnalysisEngine.executeQueuedCommands(AnalysisEngine.java:70)
    	at java.base/java.lang.Thread.run(Thread.java:829)
    Caused by: java.lang.IllegalStateException: Unable to load component class org.sonarsource.kotlin.plugin.KotlinSensor
    	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:57)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:621)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.parameters.CollectionComponentParameter.getArrayInstance(CollectionComponentParameter.java:334)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.parameters.CollectionComponentParameter.access$100(CollectionComponentParameter.java:49)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.parameters.CollectionComponentParameter$1.resolveInstance(CollectionComponentParameter.java:139)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:141)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
    	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:55)
    	... 11 more
    Caused by: java.lang.IllegalStateException: The field 'Max' does not exist or is not annotated with @RuleProperty in the class org.sonarsource.kotlin.checks.TooManyLinesOfCodeFileCheck
    	at org.sonar.api.batch.rule.Checks.configureFields(Checks.java:170)
    	at org.sonar.api.batch.rule.Checks.instantiate(Checks.java:154)
    	at org.sonar.api.batch.rule.Checks.addAnnotatedChecks(Checks.java:128)
    	at org.sonarsource.kotlin.plugin.KotlinSensor.<init>(KotlinSensor.kt:70)
    	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
    	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
    	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:55)
    	... 27 more
                  

    I also had the same problem with SonarLInt plugin 6.08.0.50884, IDEA 2022.1.4 and macOS BigSur
    idea-2022-1.4.-sonarlint-plugin-issue.log (14.1 KB)

    It seems related to the version of SonarQube: it works with SonarQube 9.4 (build 54424).
    I just updated to the latest LTS, which is 8.9.9 (build 56886), and it still doesn’t work.
    It’s not easy to move to the 9.* version because of the JDK 11 requirement for the scanner.

    Happens for me as well after updating intelliJ and SonarLint pluging:

  • Operating system: Mac OS 12.5
  • SonarLint plugin version: 6.8.0.50884
  • SonarQube: 8.9.9 (build 56886)
  • IntelliJ IDEA: IntelliJ IDEA 2022.2 (Ultimate Edition)
  • SonarLint plugin version: 7.1.0.54364
  • SonarQube: 8.9.8 (build 54436)
  • IntelliJ IDEA 2022.2.2 (Ultimate Edition:Build #IU-222.4167.29)
  • Any update on this issue, or any workarounds?

    Hello Charles,

    This bug was supposed to be fixed in the version we released yesterday, are you sure you use the 7.1.0.54364 ? Could you send us the full analysis logs, containing the full stacktrace please ?
    Thanks

    Hello,
    Apologies : the error I am seeing with the new plugin is different - I just saw the stack trace flash by after upgrading, and assumed it was the same.

    Error loading components for plugin 'javascript'
    java.lang.IllegalStateException: Unable to register extension org.sonar.api.config.PropertyDefinition from plugin 'javascript'
    	at org.sonarsource.sonarlint.core.plugin.commons.container.SpringComponentContainer.addExtension(SpringComponentContainer.java:222)
    	at org.sonarsource.sonarlint.core.plugin.commons.container.SpringComponentContainer.addExtension(SpringComponentContainer.java:37)
    	at org.sonarsource.sonarlint.core.plugin.commons.ExtensionInstaller.loadExtensions(ExtensionInstaller.java:64)
    	at org.sonarsource.sonarlint.core.plugin.commons.ExtensionInstaller.install(ExtensionInstaller.java:53)
    	at org.sonarsource.sonarlint.core.analysis.container.global.AnalysisExtensionInstaller.install(AnalysisExtensionInstaller.java:54)
    	at org.sonarsource.sonarlint.core.analysis.container.analysis.AnalysisContainer.addPluginExtensions(AnalysisContainer.java:114)
    	at org.sonarsource.sonarlint.core.analysis.container.analysis.AnalysisContainer.doBeforeStart(AnalysisContainer.java:63)
    	at org.sonarsource.sonarlint.core.plugin.commons.container.SpringComponentContainer.startComponents(SpringComponentContainer.java:180)
    	at org.sonarsource.sonarlint.core.plugin.commons.container.SpringComponentContainer.execute(SpringComponentContainer.java:161)
    	at org.sonarsource.sonarlint.core.analysis.container.module.ModuleContainer.analyze(ModuleContainer.java:71)
    	at org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand.execute(AnalyzeCommand.java:58)
    	at org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand.execute(AnalyzeCommand.java:32)
    	at org.sonarsource.sonarlint.core.analysis.AnalysisEngine$AsyncCommand.execute(AnalysisEngine.java:153)
    	at org.sonarsource.sonarlint.core.analysis.AnalysisEngine.executeQueuedCommands(AnalysisEngine.java:71)
    	at java.base/java.lang.Thread.run(Thread.java:833)
    Caused by: org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'PluginClassLoader(plugin=PluginDescriptor(name=SonarLint, id=org.sonarlint.idea, descriptorPath=plugin.xml, path=~\AppData\Roaming\JetBrains\IntelliJIdea2022.2\plugins\sonarlint-intellij, version=7.1.0.54364, package=null, isBundled=false), packagePrefix=null, instanceId=213, state=active)-org.sonar.api.config.PropertyDefinition-sonar.typescript.file.suffixes' defined in null: Cannot register bean definition [Generic bean: class [org.sonar.api.config.PropertyDefinition]; scope=singleton; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] for bean 'PluginClassLoader(plugin=PluginDescriptor(name=SonarLint, id=org.sonarlint.idea, descriptorPath=plugin.xml, path=~\AppData\Roaming\JetBrains\IntelliJIdea2022.2\plugins\sonarlint-intellij, version=7.1.0.54364, package=null, isBundled=false), packagePrefix=null, instanceId=213, state=active)-org.sonar.api.config.PropertyDefinition-sonar.typescript.file.suffixes': There is already [Generic bean: class [org.sonar.api.config.PropertyDefinition]; scope=singleton; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] bound.
    	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.DefaultListableBeanFactory.registerBeanDefinition(DefaultListableBeanFactory.java:1004)
    	at org.sonarsource.sonarlint.shaded.org.springframework.context.support.GenericApplicationContext.registerBeanDefinition(GenericApplicationContext.java:330)
    	at org.sonarsource.sonarlint.shaded.org.springframework.beans.factory.support.BeanDefinitionReaderUtils.registerBeanDefinition(BeanDefinitionReaderUtils.java:164)
    	at org.sonarsource.sonarlint.shaded.org.springframework.context.annotation.AnnotatedBeanDefinitionReader.doRegisterBean(AnnotatedBeanDefinitionReader.java:285)
    	at org.sonarsource.sonarlint.shaded.org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:233)
    	at org.sonarsource.sonarlint.shaded.org.springframework.context.annotation.AnnotationConfigApplicationContext.registerBean(AnnotationConfigApplicationContext.java:198)
    	at org.sonarsource.sonarlint.core.plugin.commons.container.SpringComponentContainer.registerInstance(SpringComponentContainer.java:106)
    	at org.sonarsource.sonarlint.core.plugin.commons.container.SpringComponentContainer.addExtension(SpringComponentContainer.java:122)
    	at org.sonarsource.sonarlint.core.plugin.commons.container.SpringComponentContainer.addExtension(SpringComponentContainer.java:220)
    	... 14 more
    [sonar-lint-anlysis.log|attachment](upload://pRim0AGr0ThKeiZH4Xo2cN1pHXX.log) (1.0 MB)
    

    I’ve attached the log - it appears to be weirdly intermittent.

    Best Wishes,

    Charles

    I’ve attached the installed sonar plugins - no, sonar-typescript-plugin is not there, as far as I can see - but it’s also not listed in the marketplace for installation either…

    sonar-plugins.json (20.8 KB)

    Could you search in your IntelliJ system storage folder (see how to find it), then go to sonarlint/storage/XXX/plugins/ and check if the sonar-typescript-plugin jar is present ? The jar should not be present, it is a leftover from a previous synchronization with the server and should have been deleted. I suspect this is causing the error.

    You can try to remove the sonarlint/storage/XXX/plugins folder and update the local storage from the SonarLint > Project settings menu. The error should disappear.

    We should probably do something about it on our side, I will let you confirm first.

    I also found this other thread that you had opened to report this same error and I forgot to answer, sorry about that.

    I did find that jar; I deleted it and Updated the local storage, and I haven’t seen a stacktrace yet…

    I suspect that’s fixed it : thanks!

    Thanks for confirming this. I did a bit more investigation, in fact this error is noisy but has no real consequence, SonarLint will work normally. In a future version we will make sure to remove this noise.

    Thanks a lot for helping us :slight_smile: