Exception: Cannot init ToolWindowManager component state: Name is null

Answered

Hi,

In our plugin, we created a toolwindow:

<extensions defaultExtensionNs="com.intellij">
    <toolWindow id="some-name" icon="/some-icon.png" anchor="bottom" factoryClass="SomeChangeGraphFactory"/>
</extensions>

The following exception will happen sometimes. It doesn't happen all the time, and it only happens when a new project was loaded into IntelliJ.

Here is the stack:

Cannot init ToolWindowManager component state: Name is null
java.lang.NullPointerException: Name is null
at java.lang.Enum.valueOf(Enum.java:236)
at com.intellij.openapi.wm.ToolWindowType.valueOf(ToolWindowType.java:18)
at com.intellij.openapi.wm.impl.WindowInfoImpl.readExternal(WindowInfoImpl.java:256)
at com.intellij.openapi.wm.impl.DesktopLayout.readExternal(DesktopLayout.java:295)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.loadState(ToolWindowManagerImpl.java:1885)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.loadState(ToolWindowManagerImpl.java:88)
at com.intellij.configurationStore.ComponentStoreImpl.doInitComponent(ComponentStoreImpl.kt:328)
at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:290)
at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:90)
at com.intellij.openapi.components.impl.PlatformComponentManagerImpl.initializeComponent(PlatformComponentManagerImpl.java:54)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:495)
at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:119)
at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:103)
at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:90)
at com.intellij.openapi.project.impl.ProjectImpl.init(ProjectImpl.java:284)
at com.intellij.openapi.project.impl.ProjectManagerImpl.initProject(ProjectManagerImpl.java:289)
at com.intellij.openapi.project.impl.ProjectManagerImpl.loadProjectWithProgress(ProjectManagerImpl.java:556)
at com.intellij.openapi.project.impl.ProjectManagerImpl.access$200(ProjectManagerImpl.java:70)
at com.intellij.openapi.project.impl.ProjectManagerImpl$2.compute(ProjectManagerImpl.java:502)
at com.intellij.openapi.project.impl.ProjectManagerImpl$2.compute(ProjectManagerImpl.java:499)
at com.intellij.openapi.progress.Task$WithResult.run(Task.java:326)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:713)

at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:397)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:543)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:488)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$null$10(ApplicationImpl.java:575)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:315)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

 

I tried to add the following line in the actionPerformed method of the AnAction class that opens this toolwindow.

graphWindow.setType(ToolWindowType.DOCKED, null);

but it didn't really help. Maybe I added it in the wrong place.

 

Please help. Many thanks.

 

1 comment
Comment actions Permalink

Your version of IDEA is quite old. Please try latest one.

0

Please sign in to leave a comment.