Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLion 2022.1 EAP: IllegalStateException: You must not register toolwindow programmatically so early. #59

Open
indeterminatus opened this issue Feb 24, 2022 · 2 comments

Comments

@indeterminatus
Copy link

I get an exception on project startup in CLion 2022.1 EAP at least, did not install previous version for regression tests.

My environment:

CLion 2022.1 EAP
Build #CL-221.4501.161, built on February 18, 2022
Licensed to CLion EAP user: XXX
Expiration date: XXX
Runtime version: 11.0.14+9-b1993.2 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2000M
Cores: 16
Registry:
    run.processes.with.pty=TRUE

Non-Bundled Plugins:
    idea.plugin.protoeditor (221.4501.155)
    com.jetbrains.plugins.ini4idea (221.4501.155)
    String Manipulation (9.2.0)
    PlantUML integration (5.11.1)
    com.vladsch.clionarduinoplugin (1.5.2)
    intellij.clion.embedded.platformio (221.4501.161)
    izhangzhihao.rainbow.brackets (6.21)
    com.yoheimuta.intellij.plugin.protolint (1.0.1)
    Batch Scripts Support (1.0.13)

See this stacktrace for reference:

java.lang.IllegalStateException: You must not register toolwindow programmatically so early. Rework code or use ToolWindowManager.invokeLater
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.getToolWindowPaneIfInitialized(ToolWindowManagerImpl.kt:490)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.registerToolWindow(ToolWindowManagerImpl.kt:923)
	at com.jetbrains.rdserver.toolWindow.BackendServerToolWindowManager.registerToolWindow(BackendServerToolWindowManager.kt:89)
	at com.intellij.openapi.wm.ToolWindowManager.registerToolWindow(ToolWindowManager.kt:62)
	at com.vladsch.clionarduinoplugin.serial.SerialMonitorToolWindow.<init>(SerialMonitorToolWindow.java:50)
	at com.vladsch.clionarduinoplugin.serial.SerialProjectComponent.projectOpened(SerialProjectComponent.java:76)
	at com.intellij.openapi.project.impl.ProjectManagerExImplKt$openProject$$inlined$executeInEdtWithProgress$1$1$lambda$1.invoke(ProjectManagerExImpl.kt:503)
	at com.intellij.openapi.project.impl.ProjectManagerExImplKt$openProject$$inlined$executeInEdtWithProgress$1$1$lambda$1.invoke(ProjectManagerExImpl.kt)
	at com.intellij.serviceContainer.ComponentManagerImpl.processInitializedComponents(ComponentManagerImpl.kt:1324)
	at com.intellij.openapi.project.impl.ProjectManagerExImplKt$openProject$$inlined$executeInEdtWithProgress$1$1.run(ProjectManagerExImpl.kt:611)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:607)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:682)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:638)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:606)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.project.impl.ProjectManagerExImplKt$openProject$$inlined$executeInEdtWithProgress$1.run(ProjectManagerExImpl.kt:460)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:215)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:197)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
	at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:511)
	at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:96)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:69)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:112)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:42)
	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:898)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:802)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
	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)

It seems I cannot open the serial monitor, after the above exception:

java.lang.Throwable: Assertion failed: dataContext has no component for new ListPopupStep
	at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:218)
	at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.createStep(PopupFactoryImpl.java:257)
	at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.<init>(PopupFactoryImpl.java:215)
	at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.<init>(PopupFactoryImpl.java:182)
	at com.intellij.ui.popup.PopupFactoryImpl.createActionGroupPopup(PopupFactoryImpl.java:336)
	at com.jetbrains.rdserver.ui.popup.BackendBePopupFactory.createActionGroupPopup(BackendBePopupFactory.kt:87)
	at com.intellij.openapi.ui.popup.JBPopupFactory.createActionGroupPopup(JBPopupFactory.java:264)
	at com.jetbrains.rdserver.ui.popup.BackendBePopupFactory.createActionGroupPopup(BackendBePopupFactory.kt:134)
	at com.vladsch.clionarduinoplugin.serial.StatusWidget.getPopupStep(StatusWidget.java:131)
	at com.vladsch.clionarduinoplugin.serial.StatusWidget.showPopup(StatusWidget.java:232)
	at com.vladsch.clionarduinoplugin.serial.StatusWidget$2.mouseClicked(StatusWidget.java:83)
	at java.desktop/java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:277)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6657)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
	at java.desktop/java.awt.Component.processEvent(Component.java:6419)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4556)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2790)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	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.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	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:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:898)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:743)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:802)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:119)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
	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)
@indeterminatus
Copy link
Author

Not sure about this plugin's development/maintenance ... the last commits were quite a while ago.

Since this prohibits me from using the serial monitor, I could try to fix it and provide a PR, if there's a chance that this gets this issue resolved :)

@coopikoop
Copy link

I have the same issue, same exception

Basirk added a commit to Basirk/CLionArduinoPlugin that referenced this issue May 31, 2022
Used this commit from another plugin to suggest a fix for this one:
antlr/intellij-plugin-v4@097170b
Note - untested and Java is not my main language.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants