JPA Persistence window error - NoClassDefFoundError: com/intellij/jpa/facet/JpaFacet
Answered
I'm setting up spring-data-jpa in my project and I've added the JPA and Spring facets.
I've also add a database to my databases window.
I'm on spring-data-jpa v1.10.3 and
However when I try to get the JPA console working, IDEA doesn't like it - I can't achieve anything in that window and just see this in the log:
2016-11-09 14:39:43,450 [5359464] ERROR - aemon.impl.PassExecutorService - IntelliJ IDEA 2016.2.5 Build #IU-162.2228.15
2016-11-09 14:39:43,450 [5359464] ERROR - aemon.impl.PassExecutorService - JDK: 1.8.0_112-release
2016-11-09 14:39:43,450 [5359464] ERROR - aemon.impl.PassExecutorService - VM: OpenJDK Server VM
2016-11-09 14:39:43,450 [5359464] ERROR - aemon.impl.PassExecutorService - Vendor: JetBrains s.r.o
2016-11-09 14:39:43,451 [5359465] ERROR - aemon.impl.PassExecutorService - OS: Windows 7
2016-11-09 14:40:21,984 [5397998] ERROR - aemon.impl.PassExecutorService - com/intellij/jpa/facet/JpaFacet
java.lang.NoClassDefFoundError: com/intellij/jpa/facet/JpaFacet
at com.intellij.spring.persistence.integration.SpringEntityManagerFactoryProvider.getPersistencePackages(SpringEntityManagerFactoryProvider.java:46)
at com.intellij.jpa.facet.JpaFacetImpl$2.fun(JpaFacetImpl.java:158)
at com.intellij.jpa.facet.JpaFacetImpl$2.fun(JpaFacetImpl.java:156)
at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1510)
at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1330)
at com.intellij.jpa.facet.JpaFacetImpl.getExtensionPersistenceUnits(JpaFacetImpl.java:155)
at com.intellij.jpa.facet.JpaFacetImpl.getPersistenceUnits(JpaFacetImpl.java:149)
at com.intellij.jpa.DefaultQlModel.processPersistenceMappings(DefaultQlModel.java:59)
at com.intellij.jpa.AbstractQlModel.getEntitiesInner(AbstractQlModel.java:90)
at com.intellij.jpa.AbstractQlModel.lambda$new$0(AbstractQlModel.java:75)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:222)
at com.intellij.psi.impl.PsiCachedValue.getValueWithLock(PsiCachedValue.java:65)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
at com.intellij.jpa.AbstractQlModel.getEntities(AbstractQlModel.java:85)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl.processUnqualifiedResolve(QlReferenceImpl.java:333)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl.processResolveVariants(QlReferenceImpl.java:161)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl.resolveInner(QlReferenceImpl.java:363)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl.access$000(QlReferenceImpl.java:48)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl$1.resolve(QlReferenceImpl.java:55)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl$1.resolve(QlReferenceImpl.java:51)
at com.intellij.psi.impl.source.resolve.ResolveCache.a(ResolveCache.java:144)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:167)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:159)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl.multiResolve(QlReferenceImpl.java:481)
at com.intellij.jpa.ql.psi.impl.QlPsiImplUtil.resolve(QlPsiImplUtil.java:49)
at com.intellij.jpa.ql.psi.impl.QlReferenceExpressionImpl.resolve(QlReferenceExpressionImpl.java:48)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl.processQualifierExpression(QlReferenceImpl.java:210)
at com.intellij.jpa.ql.psi.impl.QlCompositeElementImpl.processClauseTypeVariables(QlCompositeElementImpl.java:103)
at com.intellij.jpa.ql.psi.impl.QlCompositeElementImpl.processDeclarations(QlCompositeElementImpl.java:57)
at com.intellij.psi.util.PsiTreeUtil.treeWalkUp(PsiTreeUtil.java:1046)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl.processUnqualifiedResolve(QlReferenceImpl.java:330)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl.processResolveVariants(QlReferenceImpl.java:161)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl.resolveInner(QlReferenceImpl.java:363)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl.access$000(QlReferenceImpl.java:48)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl$1.resolve(QlReferenceImpl.java:55)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl$1.resolve(QlReferenceImpl.java:51)
at com.intellij.psi.impl.source.resolve.ResolveCache.a(ResolveCache.java:144)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:167)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:159)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl.multiResolve(QlReferenceImpl.java:481)
at com.intellij.jpa.ql.psi.impl.QlReferenceImpl.resolve(QlReferenceImpl.java:487)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl$1.visitElement(HighlightVisitorImpl.java:80)
at com.intellij.psi.impl.PsiElementBase.accept(PsiElementBase.java:274)
at com.intellij.jpa.ql.psi.impl.QlExpressionImpl.accept(QlExpressionImpl.java:25)
at com.intellij.jpa.ql.psi.impl.QlReferenceExpressionImpl.accept(QlReferenceExpressionImpl.java:27)
at com.intellij.psi.PsiWalkingState.visit(PsiWalkingState.java:64)
at com.intellij.psi.PsiWalkingState.visit(PsiWalkingState.java:26)
at com.intellij.util.WalkingState.walkChildren(WalkingState.java:65)
at com.intellij.util.WalkingState.elementStarted(WalkingState.java:52)
at com.intellij.psi.PsiWalkingState.elementStarted(PsiWalkingState.java:73)
at com.intellij.psi.PsiRecursiveElementWalkingVisitor.visitElement(PsiRecursiveElementWalkingVisitor.java:48)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl$1.visitElement(HighlightVisitorImpl.java:78)
at com.intellij.psi.PsiElementVisitor.visitFile(PsiElementVisitor.java:34)
at com.intellij.psi.PsiRecursiveElementWalkingVisitor.visitFile(PsiRecursiveElementWalkingVisitor.java:70)
at com.intellij.extapi.psi.PsiFileBase.accept(PsiFileBase.java:70)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.a(HighlightVisitorImpl.java:149)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.enumerate(InjectedLanguageUtil.java:158)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.enumerateEx(InjectedLanguageManagerImpl.java:375)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.a(HighlightVisitorImpl.java:148)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitLiteralExpression(HighlightVisitorImpl.java:776)
at com.intellij.psi.impl.source.tree.java.PsiLiteralExpressionImpl.accept(PsiLiteralExpressionImpl.java:276)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visit(HighlightVisitorImpl.java:143)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:334)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:269)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:293)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:296)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.a(HighlightVisitorImpl.java:175)
at com.intellij.codeInsight.daemon.impl.analysis.RefCountHolder.analyze(RefCountHolder.java:363)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.analyze(HighlightVisitorImpl.java:174)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:296)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:296)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:86)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:296)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:268)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:207)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:82)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:434)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1026)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:427)
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.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:426)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:402)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:154)
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)
Please sign in to leave a comment.
It looks like this could be foobarring the performance of code analysis. It says it is constantly performing code analysis and this seems to have disabled variable usage highlighting. A timely response would be v. welcome!
I have removed the JPA facet from my project and now IDEA is working again.
All the JPA queries have highlighted errors where the entities are not recognised anymore though, it's quite ugly, and of course I can't run any interactive queries in the JPA window.
What is the outlook for an update to this com.intellij.spring.persistence.integration package? Looks like some sort of class loader issue since it obviously found the interface's implementation as per the stacktrace.
Hello Adam,
It looks like broken IDE installation. Please re-download from https://www.jetbrains.com/idea/download/ and fresh re-install. Also make sure that all Spring and JPA related bundled plugins are enabled.
Hi Andrey,
I re-installed from a fresh download but the result was the same.
Interestingly, there was a nested exception below the first exception's stacktrace:
Otherwise the stacktrace was exactly the same.
It seems that needed plugin is not enabled in your IDE installation. Make sure you have all JavaEE and JPA bundled plugins enabled.
If problem remains, attach complete log starting after IDE restart and reproducing the exception.
They are enabled - see the screenshots
OK, forget that, the screenshots don't load up properly on this website.
However I have enabled the following in the Settings / Plugins dialog:
Java EE: Batch
Java EE: Bean Validation Support
Java EE: Context and Dependency
Java EE: EJB, JPA, Servlets
Java EE: JMS, JSON Processing, Concurrency
Java EE: RESTful Web Services
Java EE: Web Services (JAX-WS)
Spring AOP/@AspectJ
Spring Batch
Spring Boot
Spring Data
Spring Integration patterns
Spring OSGi
Spring Security
Spring Support
Spring Web Services
In the Project Structure / Modules dialog, I have JPA and Spring selected for the module in question.
In the Project Structure / Facets dialog, I have a JPA and several Spring facets configured for the module.
As soon as I delete the JPA facet from the module and save the dialog, then the code performance analysis in the editor finishes and everything starts working again.
>They are enabled - see the screenshots
I see no screenshots attached.
Please post the idea.log output here, starting from IDE restart and the moment when the exception occurs including the complete exception. Thanks.
re: "I see no screenshots" - I assume you read on and saw my later comments.
Here's the log:
Does the stack trace and logging help at all?
Any chance of some feedback?
Hi, sorry for delayed reply. It is strange you are having this error after re-download and re-install.
Try to remove installation completely (delete installation home directory and (re)move settings folders) , then download from http://download.jetbrains.com/idea/ideaIU-2016.2.5.win.zip and do fresh install.
Appears that similar issue was reported in our tracker: https://youtrack.jetbrains.com/issue/IDEA-154378
Hi Andrey, I'll do a fresh install with a new download as you describe and I'd post any updates on that bug report. What is the turn-around on bugs like this? Is there likely to be a fix for v2016.3?
Actually the Windows Control Panel - Programs and Features - right-click -> Deinstall does a great job of removing the whole thing.
I was on 2016.2.5 already so no update there. Is that a different URL from the normal public download?
I have to ask, what is the reason you install it at C:\Users\AdamH\AppData\Roaming\ ?
I understand that it's good to have the configurable and editable files there, but not the whole program. It just add to the load for either network shares or backups, especially in a corporate environment.