AsyncTreeModel: Background invoker shall not be EDT
Hi,
I use Tree and AsyncTreeModel to display data to users and in the 2023.1 release I started to get reports with the following stack trace:
java.lang.Throwable: Background invoker shall not be EDT
at com.intellij.ui.tree.AsyncTreeModel.<init>(AsyncTreeModel.java:104)
at com.intellij.ui.tree.AsyncTreeModel.<init>(AsyncTreeModel.java:89)
at com.dcm.problemsView.DCMProblemsViewPanel.createTreeView(DCMProblemsViewPanel.kt:107)
at com.dcm.problemsView.DCMProblemsViewPanel.<init>(DCMProblemsViewPanel.kt:39)
at com.dcm.problemsView.DCMProblemsViewPanelFactory.createToolWindowContent(DCMProblemsViewPanelFactory.kt:20)
at com.intellij.openapi.wm.impl.ToolWindowImpl.createContentIfNeeded(ToolWindowImpl.kt:548)
at com.intellij.openapi.wm.impl.ToolWindowImpl.getContentManager(ToolWindowImpl.kt:421)
at com.dcm.problemsView.DCMProblemsView.getProblemsViewPanel(DCMProblemsView.kt:32)
at com.dcm.problemsView.DCMProblemsView.updateErrorsForFile$lambda$2$lambda$1(DCMProblemsView.kt:47)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:249)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:365)
at com.intellij.util.Alarm$Request.run(Alarm.java:354)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:272)
Considering that everting was working before I'm not sure that it's something on my side that should be changed.
Can you advise on how to fix this exception? I've found this open issue https://youtrack.jetbrains.com/issue/WI-70821/java.lang.Throwable-Background-invoker-shall-not-be-EDT, but it seems that it's for your own component with no steps on how to solve that for others.
Thank you.
Please sign in to leave a comment.
Hi,
The exception messages has been extended recently to:
https://github.com/JetBrains/intellij-community/blob/master/platform/platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java#L104
Karol Lewandowski thank you