最近把IntelliJ IDEA升級到2016.2.1後,在JSP裡的code complete就有問題,在物件變數後按 . 應該要出現能使用的多個methods,卻只出現一個,查了C:\Users\使用者.IntelliJIdea2016.2\system\log\idea.log後發現有Exception:
2016-08-15 22:04:56,351 [ 302048] ERROR - on.CompletionProgressIndicator - com.intellij.psi.impl.source.jsp.JspJavaFileImpl cannot be cast to com.intellij.psi.jsp.JspFile java.lang.ClassCastException: com.intellij.psi.impl.source.jsp.JspJavaFileImpl cannot be cast to com.intellij.psi.jsp.JspFile at com.intellij.psi.impl.source.jsp.JspContextManagerImpl.processContextElements(JspContextManagerImpl.java:209) at com.intellij.psi.impl.source.jsp.JspJavaFileImpl.processDeclarations(JspJavaFileImpl.java:49) at com.intellij.psi.scope.util.PsiScopesUtil.treeWalkUp(PsiScopesUtil.java:68) at com.intellij.psi.scope.util.PsiScopesUtil.treeWalkUp(PsiScopesUtil.java:50) at com.intellij.psi.scope.util.PsiScopesUtil.resolveAndWalk(PsiScopesUtil.java:226) at com.intellij.psi.scope.util.PsiScopesUtil.resolveAndWalk(PsiScopesUtil.java:157) at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.a(PsiJavaCodeReferenceElementImpl.java:448) at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.access$100(PsiJavaCodeReferenceElementImpl.java:55) at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:350) at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:342) at com.intellij.psi.impl.source.resolve.ResolveCache$4.compute(ResolveCache.java:191) at com.intellij.psi.impl.source.resolve.ResolveCache$4.compute(ResolveCache.java:188) at com.intellij.openapi.util.RecursionManager$2.doPreventingRecursion(RecursionManager.java:112) at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:188) at com.intellij.psi.impl.PsiImplUtil.multiResolveImpl(PsiImplUtil.java:752) at com.intellij.psi.impl.PsiImplUtil.multiResolveImpl(PsiImplUtil.java:741) at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.multiResolve(PsiJavaCodeReferenceElementImpl.java:377) at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.advancedResolve(PsiJavaCodeReferenceElementImpl.java:370) at com.intellij.psi.impl.source.PsiClassReferenceType.resolveGenerics(PsiClassReferenceType.java:145) at com.intellij.psi.util.PsiUtil.captureToplevelWildcards(PsiUtil.java:784) at com.intellij.psi.impl.PsiImplUtil.normalizeWildcardTypeByPosition(PsiImplUtil.java:384) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl$TypeEvaluator.fun(PsiReferenceExpressionImpl.java:416) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl$TypeEvaluator.fun(PsiReferenceExpressionImpl.java:361) at com.intellij.psi.impl.source.resolve.JavaResolveCache.getType(JavaResolveCache.java:87) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl.getType(PsiReferenceExpressionImpl.java:428) at com.intellij.codeInsight.template.postfix.util.JavaPostfixTemplatesUtils.c(JavaPostfixTemplatesUtils.java:153) at com.intellij.openapi.util.Conditions$And.value(Conditions.java:179) at com.intellij.openapi.util.Conditions$And.value(Conditions.java:179) at com.intellij.util.containers.ContainerUtil.findAll(ContainerUtil.java:1029) at com.intellij.util.containers.ContainerUtil.filter(ContainerUtil.java:1008) at com.intellij.codeInsight.template.postfix.templates.PostfixTemplateExpressionSelectorBase.getExpressions(PostfixTemplateExpressionSelectorBase.java:60) at com.intellij.codeInsight.template.postfix.templates.PostfixTemplateExpressionSelectorBase.hasExpression(PostfixTemplateExpressionSelectorBase.java:50) at com.intellij.codeInsight.template.postfix.templates.PostfixTemplateWithExpressionSelector.isApplicable(PostfixTemplateWithExpressionSelector.java:54) at com.intellij.codeInsight.template.postfix.templates.PostfixLiveTemplate.a(PostfixLiveTemplate.java:266) at com.intellij.codeInsight.template.postfix.templates.PostfixLiveTemplate.getLookupElements(PostfixLiveTemplate.java:211) at com.intellij.codeInsight.template.CustomLiveTemplateBase.addCompletions(CustomLiveTemplateBase.java:53) at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor.a(LiveTemplateCompletionContributor.java:153) at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor.access$100(LiveTemplateCompletionContributor.java:50) at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$2.a(LiveTemplateCompletionContributor.java:93) at com.intellij.codeInsight.completion.CompletionResultSet.passResult(CompletionResultSet.java:69) at com.intellij.codeInsight.completion.JavaNoVariantsDelegator$ResultTracker.consume(JavaNoVariantsDelegator.java:206) at com.intellij.codeInsight.completion.JavaNoVariantsDelegator$1.consume(JavaNoVariantsDelegator.java:49) at com.intellij.codeInsight.completion.JavaNoVariantsDelegator$1.consume(JavaNoVariantsDelegator.java:46) at com.intellij.codeInsight.completion.CompletionResultSet.passResult(CompletionResultSet.java:69) at com.intellij.codeInsight.completion.impl.CompletionServiceImpl$CompletionResultSetImpl.addElement(CompletionServiceImpl.java:135) at com.intellij.codeInsight.completion.JavaCompletionContributor.a(JavaCompletionContributor.java:412) at com.intellij.codeInsight.completion.LegacyCompletionContributor.a(LegacyCompletionContributor.java:124) at com.intellij.codeInsight.completion.LegacyCompletionContributor.processReferences(LegacyCompletionContributor.java:107) at com.intellij.codeInsight.completion.JavaCompletionContributor.b(JavaCompletionContributor.java:366) at com.intellij.codeInsight.completion.JavaCompletionContributor.fillCompletionVariants(JavaCompletionContributor.java:234) at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81) at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:132) at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:125) at com.intellij.codeInsight.completion.JavaNoVariantsDelegator.fillCompletionVariants(JavaNoVariantsDelegator.java:61) at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81) at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:132) at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:125) at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$2.addCompletions(LiveTemplateCompletionContributor.java:90) at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36) at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:155) at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81) at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:110) at com.intellij.codeInsight.completion.CompletionProgressIndicator.a(CompletionProgressIndicator.java:776) at com.intellij.codeInsight.completion.CompletionProgressIndicator.access$500(CompletionProgressIndicator.java:90) at com.intellij.codeInsight.completion.CompletionProgressIndicator$1CalculateItems.run(CompletionProgressIndicator.java:758) at com.intellij.codeInsight.completion.AsyncCompletion.b(CompletionThreading.java:87) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:856) at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:84) at com.intellij.openapi.progress.impl.CoreProgressManager$3.run(CoreProgressManager.java:170) at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:494) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:155) at com.intellij.codeInsight.completion.AsyncCompletion.a(CompletionThreading.java:82) at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:308) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 2016-08-15 22:04:56,351 [ 302048] ERROR - on.CompletionProgressIndicator - IntelliJ IDEA 2016.2.1 Build #IU-162.1447.26
最後重新安裝2016.2.2的EAP版就正常了。
##
您可能也會有興趣的類似文章
- [IntelliJ IDEA] Java / JavaScript除錯小技巧 (0則留言, 2014/08/14)
- 用IntelliJ IDEA的GUI Designer開發Swing程式 (0則留言, 2014/02/14)
- 快速建立IntelliJ IDEA的Live Template的步驟 (0則留言, 2014/02/21)
- 如何在啟動IntelliJ IDEA idea64.exe時指定特定JDK (0則留言, 2015/11/14)
- Migration Guide: Eclipse ✈ IntelliJ IDEA (0則留言, 2015/07/07)
- [Java] 終於解決IntelliJ-IDEA 8.0.1的中文輸入法問題 (7則留言, 2008/12/04)
- 方便的IntelliJ IDEA外掛:Terminal (0則留言, 2015/01/27)
- 使用IntelliJ IDEA建立Spring Boot專案 (0則留言, 2016/03/18)
- 使用IntelliJ IDEA 12的Android UI Designer輕鬆寫Android App (1則留言, 2012/08/09)
- IntelliJ IDEA直接開啟專案的方法 (0則留言, 2010/06/03)
- 由桌面啟動IntelliJ IDEA 14 64-bit執行檔 (0則留言, 2014/11/07)
- 方便的IntelliJ IDEA Markdown外掛idea-multimarkdown (0則留言, 2015/11/14)
- 原來IntelliJ IDEA也有中文的網站 (0則留言, 2008/08/22)
- 使用IntelliJ IDEA快速設定svn:keywords的方法 (0則留言, 2014/04/04)
- 在IntelliJ IDEA裡以Scratch外掛隨時記錄備忘與開啟外部文件 (0則留言, 2016/03/20)