AssertionError:No ID found for serializer

Hello,
In my plugin I'm getting this error right after opening project:

No ID found for serializer NLS_INCLUDE_PROPERTY (ru.crazyproger.plugins.webtoper.nls.parser.NlsIncludePropertyStubElementType): No ID found for serializer NLS_INCLUDE_PROPERTY (ru.crazyproger.plugins.webtoper.nls.parser.NlsIncludePropertyStubElementType)
java.lang.AssertionError: No ID found for serializer NLS_INCLUDE_PROPERTY (ru.crazyproger.plugins.webtoper.nls.parser.NlsIncludePropertyStubElementType)
    at com.intellij.psi.stubs.StubSerializationHelper.getClassId(StubSerializationHelper.java:102)
    at com.intellij.psi.stubs.StubSerializationHelper.doSerialize(StubSerializationHelper.java:74)
    at com.intellij.psi.stubs.StubSerializationHelper.doSerialize(StubSerializationHelper.java:81)
    at com.intellij.psi.stubs.StubSerializationHelper.doSerialize(StubSerializationHelper.java:81)
    at com.intellij.psi.stubs.StubSerializationHelper.serialize(StubSerializationHelper.java:90)
    at com.intellij.psi.stubs.SerializationManagerImpl.serialize(SerializationManagerImpl.java:152)
    at com.intellij.psi.stubs.StubUpdatingIndex$3$1.run(StubUpdatingIndex.java:124)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:924)
    at com.intellij.psi.stubs.StubUpdatingIndex$3.map(StubUpdatingIndex.java:117)
    at com.intellij.psi.stubs.StubUpdatingIndex$3.map(StubUpdatingIndex.java:111)
    at com.intellij.util.indexing.MapReduceIndex.update(MapReduceIndex.java:215)
    at com.intellij.util.indexing.FileBasedIndexImpl$22.run(FileBasedIndexImpl.java:1502)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeNonCancelableSection(ProgressManagerImpl.java:143)
    at com.intellij.util.indexing.FileBasedIndexImpl.a(FileBasedIndexImpl.java:1470)
    at com.intellij.util.indexing.FileBasedIndexImpl.a(FileBasedIndexImpl.java:1362)
    at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:777)
    at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:751)
    at com.intellij.psi.stubs.StubIndexImpl.process(StubIndexImpl.java:207)
    at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:196)
    at com.intellij.psi.stubs.AbstractStubIndex.get(AbstractStubIndex.java:33)
    at com.intellij.lang.properties.PropertiesUtil.findPropertiesByKey(PropertiesUtil.java:65)
    at com.intellij.lang.properties.references.PropertyReferenceBase.multiResolve(PropertyReferenceBase.java:205)
    at com.intellij.lang.properties.references.PropertyReferenceBase.isReferenceTo(PropertyReferenceBase.java:166)
    at com.intellij.psi.search.SingleTargetRequestResultProcessor.processTextOccurrence(SingleTargetRequestResultProcessor.java:44)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$20.execute(PsiSearchHelperImpl.java:685)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.a(LowLevelSearchUtil.java:122)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.processElementsContainingWordInElement(LowLevelSearchUtil.java:170)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$5.process(PsiSearchHelperImpl.java:202)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$5.process(PsiSearchHelperImpl.java:199)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$7$2.run(PsiSearchHelperImpl.java:255)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:924)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$7.process(PsiSearchHelperImpl.java:236)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$7.process(PsiSearchHelperImpl.java:225)
    at com.intellij.concurrency.JobLauncherImpl$2$1.run(JobLauncherImpl.java:115)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:232)
    at com.intellij.concurrency.JobLauncherImpl$2.process(JobLauncherImpl.java:113)
    at com.intellij.concurrency.JobLauncherImpl$1.run(JobLauncherImpl.java:54)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at com.intellij.concurrency.PrioritizedFutureTask.access$101(PrioritizedFutureTask.java:31)
    at com.intellij.concurrency.PrioritizedFutureTask$1.run(PrioritizedFutureTask.java:70)
    at com.intellij.concurrency.PrioritizedFutureTask.run(PrioritizedFutureTask.java:105)
    at com.intellij.concurrency.JobImpl.scheduleAndWaitForResults(JobImpl.java:136)
    at com.intellij.concurrency.JobLauncherImpl.a(JobLauncherImpl.java:68)
    at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgress(JobLauncherImpl.java:110)
    at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgressAsync(JobLauncherImpl.java:131)
    at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgressAsync(JobLauncherImpl.java:37)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.a(PsiSearchHelperImpl.java:225)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.a(PsiSearchHelperImpl.java:199)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.processElementsWithWordAsync(PsiSearchHelperImpl.java:138)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.c(PsiSearchHelperImpl.java:838)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.a(PsiSearchHelperImpl.java:606)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.access$400(PsiSearchHelperImpl.java:55)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$17.body(PsiSearchHelperImpl.java:534)
    at com.intellij.concurrency.DoWhile.getResult(DoWhile.java:30)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.processRequestsAsync(PsiSearchHelperImpl.java:578)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.processRequests(PsiSearchHelperImpl.java:514)
    at com.intellij.psi.search.SearchRequestQuery.processResults(SearchRequestQuery.java:29)
    at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:76)
    at com.intellij.util.MergeQuery.processSubQuery(MergeQuery.java:78)
    at com.intellij.util.MergeQuery.forEach(MergeQuery.java:53)
    at com.intellij.util.MergeQuery.findFirst(MergeQuery.java:48)
    at com.intellij.util.UniqueResultsQuery.findFirst(UniqueResultsQuery.java:51)
    at com.intellij.codeInspection.unused.UnusedPropertyInspection$1.visitElement(UnusedPropertyInspection.java:93)
    at com.intellij.psi.impl.PsiElementBase.accept(PsiElementBase.java:232)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:410)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:368)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.access$100(LocalInspectionsPass.java:77)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$2.process(LocalInspectionsPass.java:327)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$2.process(LocalInspectionsPass.java:305)
    at com.intellij.concurrency.JobLauncherImpl$2$1.run(JobLauncherImpl.java:115)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:232)
    at com.intellij.concurrency.JobLauncherImpl$2.process(JobLauncherImpl.java:113)
    at com.intellij.concurrency.JobLauncherImpl$1.run(JobLauncherImpl.java:54)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at com.intellij.concurrency.PrioritizedFutureTask.access$101(PrioritizedFutureTask.java:31)
    at com.intellij.concurrency.PrioritizedFutureTask$1.run(PrioritizedFutureTask.java:70)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1155)
    at com.intellij.concurrency.PrioritizedFutureTask.run(PrioritizedFutureTask.java:97)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)



Bit information about my plugin: it is an extension to Properties language. "lang.parserDefinition" and "lang.ast.factory" are overrided.
Also I create some PSI: NLS_INCLUDE_PROPERTY - Type of token that can occur as sibling for Property.

Could someone explain why I get this exception and how to avoid it?

Thanks in advance!

EDIT:
Full code can be obtained here https://github.com/crazyproger/webtoper/

3 comments
Comment actions Permalink

I have been having this symptom myself for a few months now. Each time I make a fix the symptom will manifest in a new way. All with the same error.

I was hoping someone else might have the same issue as I do.

Taking a very quick look at your code. I think in your case you didn't register  the extension point::

 <stubElementTypeHolder  n">ru.crazyproger.plugins.webtoper.nls.parser.NlsElementTypes"/>
0
Comment actions Permalink

Thank you very much! This seems exactly what I need.

0
Comment actions Permalink

Just had the same issue, but the origin was different in my case: I instantiated twice my IStubElementType, and both instances returned the same external ID (in getExternalId()), so I had a first exception:

java.lang.AssertionError: ID: ksp.constraints is not unique; Already registered serializer with this ID: ...


Then I got the exception you encountered. Using different external IDs solved the problem (+invalidating caches, of course)

0

Please sign in to leave a comment.