intellij idea 报 Stub index points to a file without PSI
程序员文章站
2022-03-04 13:34:15
...
最近我改写一个项目,一打开项目idea一直在报一个错误,导致项目打开后无法正常编译,错误如下:
Stub index points to a file without PSI: [email protected]
java.lang.Throwable: Stub index points to a file without PSI: [email protected]
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:136)
at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:47)
at com.intellij.psi.stubs.StubIndexImpl$2.process(StubIndexImpl.java:327)
at com.intellij.psi.stubs.StubIndexImpl$StubIdListContainerAction.perform(StubIndexImpl.java:618)
at com.intellij.psi.stubs.StubIndexImpl$StubIdListContainerAction.perform(StubIndexImpl.java:606)
at com.intellij.util.indexing.ValueContainer.forEach(ValueContainer.java:62)
at com.intellij.psi.stubs.StubIndexImpl.a(StubIndexImpl.java:356)
at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:319)
at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:145)
at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:134)
at com.intellij.psi.impl.java.stubs.index.JavaShortClassNameIndex.get(JavaShortClassNameIndex.java:53)
at com.intellij.psi.impl.PsiShortNamesCacheImpl.getClassesByName(PsiShortNamesCacheImpl.java:63)
at com.intellij.psi.impl.CompositeShortNamesCache.getClassesByName(CompositeShortNamesCache.java:77)
at org.jetbrains.kotlin.idea.search.PsiBasedClassResolver.findPotentialClassConflicts(PsiBasedClassResolver.kt:79)
at org.jetbrains.kotlin.idea.search.PsiBasedClassResolver.access$findPotentialClassConflicts(PsiBasedClassResolver.kt:45)
at org.jetbrains.kotlin.idea.search.PsiBasedClassResolver$1.invoke(PsiBasedClassResolver.kt:73)
at org.jetbrains.kotlin.idea.search.PsiBasedClassResolver$1.invoke(PsiBasedClassResolver.kt:45)
at org.jetbrains.kotlin.idea.util.application.ApplicationUtilsKt$sam$Computable$4c46934c.compute(ApplicationUtils.kt)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:923)
at org.jetbrains.kotlin.idea.util.application.ApplicationUtilsKt.runReadAction(ApplicationUtils.kt:24)
at org.jetbrains.kotlin.idea.search.PsiBasedClassResolver.<init>(PsiBasedClassResolver.kt:72)
at org.jetbrains.kotlin.idea.search.ideaExtensions.KotlinAnnotatedElementsSearcher$Companion.processAnnotatedMembers(KotlinAnnotatedElementsSearcher.kt:81)
at org.jetbrains.kotlin.idea.search.ideaExtensions.KotlinAnnotatedElementsSearcher$Companion.processAnnotatedMembers$default(KotlinAnnotatedElementsSearcher.kt:77)
at org.jetbrains.kotlin.idea.search.ideaExtensions.KotlinAnnotatedElementsSearcher.execute(KotlinAnnotatedElementsSearcher.kt:49)
at org.jetbrains.kotlin.idea.search.ideaExtensions.KotlinAnnotatedElementsSearcher.execute(KotlinAnnotatedElementsSearcher.kt:46)
at com.intellij.util.ExecutorsQuery.processResults(ExecutorsQuery.java:45)
at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:80)
at com.intellij.util.InstanceofQuery.forEach(InstanceofQuery.java:58)
at com.intellij.codeInsight.MetaAnnotationUtil.getChildren(MetaAnnotationUtil.java:90)
at com.intellij.codeInsight.MetaAnnotationUtil.collectClassWithChildren(MetaAnnotationUtil.java:146)
at com.intellij.codeInsight.MetaAnnotationUtil.collectClassWithChildren(MetaAnnotationUtil.java:148)
at com.intellij.codeInsight.MetaAnnotationUtil.getAnnotationTypesWithChildren(MetaAnnotationUtil.java:122)
at com.intellij.codeInsight.MetaAnnotationUtil.lambda$null$0(MetaAnnotationUtil.java:71)
at com.intellij.util.containers.ConcurrentFactoryMap$4.create(ConcurrentFactoryMap.java:223)
at com.intellij.util.containers.ConcurrentFactoryMap.get(ConcurrentFactoryMap.java:62)
at com.intellij.codeInsight.MetaAnnotationUtil.getAnnotationTypesWithChildren(MetaAnnotationUtil.java:76)
at com.intellij.spring.model.jam.utils.JamAnnotationTypeUtilImpl.getAnnotationTypes(JamAnnotationTypeUtilImpl.java:139)
at com.intellij.spring.model.jam.utils.JamAnnotationTypeUtilImpl.getAnnotationTypesWithChildren(JamAnnotationTypeUtilImpl.java:128)
at com.intellij.spring.model.jam.utils.JamAnnotationTypeUtilImpl.getCustomComponentAnnotations(JamAnnotationTypeUtilImpl.java:122)
at com.intellij.spring.model.jam.utils.JamAnnotationTypeUtilImpl.getUserDefinedCustomComponentAnnotations(JamAnnotationTypeUtilImpl.java:102)
at com.intellij.spring.model.jam.SpringSemContributor.lambda$getUserDefinedCustomAnnotations$14(SpringSemContributor.java:347)
at com.intellij.spring.model.jam.SpringSemContributorUtil.lambda$createFunction$2(SpringSemContributorUtil.java:128)
at com.intellij.semantic.SemServiceImpl$2.b(SemServiceImpl.java:92)
at com.intellij.semantic.SemServiceImpl.a(SemServiceImpl.java:189)
at com.intellij.semantic.SemServiceImpl.getSemElements(SemServiceImpl.java:160)
at com.intellij.jam.JamService.getMetas(JamService.java:128)
at com.intellij.jam.JamSemContributor.a(JamSemContributor.java:72)
at com.intellij.semantic.SemServiceImpl$2.b(SemServiceImpl.java:92)
at com.intellij.semantic.SemServiceImpl.a(SemServiceImpl.java:189)
at com.intellij.semantic.SemServiceImpl.getSemElements(SemServiceImpl.java:160)
at com.intellij.jam.JamService.getMetas(JamService.java:128)
at com.intellij.jam.JamSemContributor.c(JamSemContributor.java:53)
at com.intellij.semantic.SemServiceImpl$2.b(SemServiceImpl.java:92)
at com.intellij.semantic.SemServiceImpl.a(SemServiceImpl.java:189)
at com.intellij.semantic.SemServiceImpl.getSemElements(SemServiceImpl.java:160)
at com.intellij.jam.JamReferenceContributor$registerReferenceProviders$2.getReferencesByElement(JamReferenceContributor.kt:45)
at com.intellij.psi.UastReferenceProviderAdapter.getReferencesByElement(UastReferenceRegistrar.kt:69)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:135)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:123)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:102)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:59)
at com.intellij.psi.PsiReferenceServiceImpl.getReferences(PsiReferenceServiceImpl.java:32)
at com.intellij.psi.PsiReferenceService.getContributedReferences(PsiReferenceService.java:52)
at com.intellij.psi.impl.source.tree.java.PsiLiteralExpressionImpl.getReferences(PsiLiteralExpressionImpl.java:206)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitLiteralExpression(HighlightVisitorImpl.java:809)
at com.intellij.psi.impl.source.tree.java.PsiLiteralExpressionImpl.accept(PsiLiteralExpressionImpl.java:182)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visit(HighlightVisitorImpl.java:138)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:371)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:309)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:330)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:333)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.a(HighlightVisitorImpl.java:163)
at com.intellij.codeInsight.daemon.impl.analysis.RefCountHolder.analyze(RefCountHolder.java:336)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.analyze(HighlightVisitorImpl.java:162)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:333)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:333)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:86)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:333)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:300)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:239)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:83)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:437)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1127)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:430)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(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.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.d(PassExecutorService.java:429)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:405)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:143)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:229)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:403)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:170)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
于是我在网上各种查找问题,相关错误屈指可数。
终于我在一个跟我错误差不多帖子的最后看到了错误可能发生原因。
原来,我们项目最近由SVN转为git。我就在项目中加了一个.gitignore文件 用来在提交代码的时候忽略一些文件。把该文件删除后,错误消失。
-----------------------------------------------------------------------------
后来又出现此问题,解决方法:
File
> Invalidate Caches/Restart > Invalidate and Restart
上一篇: IntelliJ IDEA常用设置
下一篇: Vue 前后端分离部署 nginx 配置