Uploaded image for project: 'SonarLint For IntelliJ'
  1. SonarLint For IntelliJ
  2. SLI-564

Exception when creating module change listener

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0.1
    • Component/s: Standalone Mode
    • Labels:
      None

      Description

      In some cases, the module change listener cannot be initialized:

      
      com.intellij.diagnostic.PluginException: Cannot create class org.sonarlint.intellij.module.ModuleChangeListener (classloader=PluginClassLoader(plugin=PluginDescriptor(name=SonarLint, id=org.sonarlint.idea, descriptorPath=plugin.xml, path=~\AppData\Roaming\JetBrains\IntelliJIdea2021.1\plugins\sonarlint-intellij, version=5.0.0.33494, package=null), packagePrefix=null, instanceId=80, state=active))
      	at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:763)
      	at com.intellij.serviceContainer.ComponentManagerImpl.createListener(ComponentManagerImpl.kt:802)
      	at com.intellij.util.messages.impl.CompositeMessageBus.subscribeLazyListeners(CompositeMessageBus.java:187)
      	at com.intellij.util.messages.impl.CompositeMessageBus.doComputeSubscribers(CompositeMessageBus.java:157)
      	at com.intellij.util.messages.impl.MessageBusImpl.computeSubscribers(MessageBusImpl.java:356)
      	at com.intellij.util.messages.impl.CompositeMessageBus.computeSubscribers(CompositeMessageBus.java:151)
      	at com.intellij.util.messages.impl.MessageBusImpl$MessagePublisher.lambda$publish$0(MessageBusImpl.java:192)
      	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
      	at com.intellij.util.messages.impl.MessageBusImpl$MessagePublisher.publish(MessageBusImpl.java:192)
      	at com.intellij.util.messages.impl.MessageBusImpl$MessagePublisher.invoke(MessageBusImpl.java:181)
      	at com.sun.proxy.$Proxy82.moduleAdded(Unknown Source)
      	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerComponentBridge.fireModuleAdded(ModuleManagerComponentBridge.kt:384)
      	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerComponentBridge.access$fireModuleAdded(ModuleManagerComponentBridge.kt:52)
      	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerComponentBridge$fireModuleAddedInWriteAction$1.run(ModuleManagerComponentBridge.kt:378)
      	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:959)
      	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerComponentBridge.fireModuleAddedInWriteAction(ModuleManagerComponentBridge.kt:375)
      	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerComponentBridge.fireModulesAdded(ModuleManagerComponentBridge.kt:370)
      	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerComponentBridge.access$fireModulesAdded(ModuleManagerComponentBridge.kt:52)
      	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerComponentBridge$1.projectOpened(ModuleManagerComponentBridge.kt:91)
      	at com.intellij.util.messages.impl.MessageBusImpl.invokeMethod(MessageBusImpl.java:674)
      	at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:649)
      	at com.intellij.util.messages.impl.MessageBusImpl.deliverMessage(MessageBusImpl.java:422)
      	at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:397)
      	at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:379)
      	at com.intellij.util.messages.impl.MessageBusImpl.access$100(MessageBusImpl.java:33)
      	at com.intellij.util.messages.impl.MessageBusImpl$MessagePublisher.invoke(MessageBusImpl.java:185)
      	at com.sun.proxy.$Proxy81.projectOpened(Unknown Source)
      	at com.intellij.openapi.project.impl.ProjectManagerExImplKt$openProject$1.run(ProjectManagerExImpl.kt:376)
      	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:218)
      	at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
      	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:200)
      	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781)
      	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeAndWait$7(ApplicationImpl.java:428)
      	at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:134)
      	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
      	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:133)
      	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
      	at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:189)
      	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
      	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
      	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
      	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
      	at java.base/java.security.AccessController.doPrivileged(Native Method)
      	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
      	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
      	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:969)
      	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:839)
      	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:449)
      	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:808)
      	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
      	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781)
      	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:496)
      	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
      	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
      	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
      	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
      	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
      	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
      Caused by: java.lang.reflect.InvocationTargetException
      	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 com.intellij.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:742)
      	... 57 more
      Caused by: java.lang.IllegalStateException: Recursive update
      	at java.base/java.util.concurrent.ConcurrentHashMap.replaceNode(ConcurrentHashMap.java:1167)
      	at java.base/java.util.concurrent.ConcurrentHashMap.remove(ConcurrentHashMap.java:1102)
      	at com.intellij.util.messages.impl.MessageBusImpl.notifyOnSubscription(MessageBusImpl.java:440)
      	at com.intellij.util.messages.impl.BaseBusConnection.subscribe(BaseBusConnection.java:38)
      	at org.sonarlint.intellij.module.ModuleChangeListener.<init>(ModuleChangeListener.kt:43)
      	... 62 more
      

      This seems due to a race condition in the initialization of the eventing system, and it seems that it already happened on some JetBrains-provided plugin in the past.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              damien.urruty Damien Urruty
              Reporter:
              jeanbaptiste.lievremont Jean-Baptiste Lievremont
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: