migrating from JDomExternalizable to PersistentState

Here is the exception i get when my project tries to load.
And it results in persistent state not being restored

java.lang.NullPointerException
at com.intellij.openapi.components.impl.stores.ComponentStoreImpl.d(ComponentStoreImpl.java:132)
at com.intellij.openapi.components.impl.stores.ComponentStoreImpl.b(ComponentStoreImpl.java:18)
at com.intellij.openapi.components.impl.stores.ComponentStoreImpl.access$000(ComponentStoreImpl.java:119)
at com.intellij.openapi.components.impl.stores.ComponentStoreImpl$1.run(ComponentStoreImpl.java:3)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:201)
at com.intellij.openapi.components.impl.stores.ComponentStoreImpl.initComponent(ComponentStoreImpl.java:3)
at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:107)
at com.intellij.openapi.components.impl.ComponentManagerImpl.access$1100(ComponentManagerImpl.java:73)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:0)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:29)
at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:193)
at com.intellij.util.pico.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:180)
at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:162)
at org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer.getComponentInstance(AbstractDelegatingMutablePicoContainer.java:75)
at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:50)
at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:58)
at com.intellij.openapi.components.impl.ComponentManagerImpl.initComponents(ComponentManagerImpl.java:41)
at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:59)
at com.intellij.openapi.project.impl.ProjectImpl.init(ProjectImpl.java:96)
at com.intellij.openapi.components.impl.stores.ProjectStoreImpl.loadProject(ProjectStoreImpl.java:74)
at com.intellij.openapi.project.impl.ProjectManagerImpl.loadProject(ProjectManagerImpl.java:29)
at com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOpenProject(ProjectManagerImpl.java:104)
at com.intellij.ide.impl.ProjectUtil.openProject(ProjectUtil.java:66)
at com.intellij.idea.IdeaApplication.c(IdeaApplication.java:16)
at com.intellij.idea.IdeaApplication.access$400(IdeaApplication.java:50)
at com.intellij.idea.IdeaApplication$IdeStarter$2.run(IdeaApplication.java:2)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:3)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:59)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:118)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:62)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

4 comments

this is on 7.0M1a.

I guess i'm doing something wrong, but i don't know what

0

This is indeed strange. Can you post a snippet? The only idea I have is
that you extended PSC]]> in your component interface, not implementation.

0

the class that i was trying to migrate is the following one

http://ideamksplugin.googlecode.com/svn/trunk/src/main/java/org/intellij/vcs/mks/MksConfiguration.java

Here is the relevant portion of the plugin.xml
org.intellij.vcs.mks.MksVcs org.intellij.vcs.mks.MksVcs org.intellij.vcs.mks.MksConfiguration org.intellij.vcs.mks.MksConfiguration ]]>



Based on the existing implementation (org.jetbrains.idea.perforce.perforce.PerforceSettings) I found in the perforce plugins i replaced the readExternal/writeExternal methods with the following loadState/getState methods

public MksConfiguration getState() {
return this;
}

public void loadState(MksConfiguration object) {
XmlSerializerUtil.copyBean(object, this);
}

0

Please sign in to leave a comment.