question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

exception in jte plugin: LeafPsiElement cannot be cast to class CompositeElement

See original GitHub issue

I’m not sure how to reproduce this, and it doesn’t cause me any obvious trouble, just reporting some stuff my IDE showed me.

java.lang.ClassCastException: class com.intellij.psi.impl.source.tree.LeafPsiElement cannot be cast to class com.intellij.psi.impl.source.tree.CompositeElement (com.intellij.psi.impl.source.tree.LeafPsiElement and com.intellij.psi.impl.source.tree.CompositeElement are in unnamed module of loader com.intellij.util.lang.UrlClassLoader @6a2bcfcb)
	at com.intellij.psi.impl.DiffLog$InsertEntry.<init>(DiffLog.java:167)
	at com.intellij.psi.impl.DiffLog$InsertEntry.<init>(DiffLog.java:160)
	at com.intellij.psi.impl.DiffLog.nodeInserted(DiffLog.java:75)
	at com.intellij.psi.impl.DiffLog.nodeInserted(DiffLog.java:27)
	at com.intellij.lang.impl.PsiBuilderImpl$ConvertFromTokensToASTBuilder.nodeInserted(PsiBuilderImpl.java:975)
	at com.intellij.lang.impl.PsiBuilderImpl$ConvertFromTokensToASTBuilder.nodeInserted(PsiBuilderImpl.java:957)
	at com.intellij.util.diff.DiffTree.build(DiffTree.java:135)
	at com.intellij.util.diff.DiffTree.build(DiffTree.java:122)
	at com.intellij.util.diff.DiffTree.build(DiffTree.java:122)
	at com.intellij.util.diff.DiffTree.build(DiffTree.java:122)
	at com.intellij.util.diff.DiffTree.build(DiffTree.java:122)
	at com.intellij.util.diff.DiffTree.diff(DiffTree.java:44)
	at com.intellij.psi.impl.BlockSupportImpl.diffTrees(BlockSupportImpl.java:354)
	at com.intellij.lang.impl.PsiBuilderImpl.merge(PsiBuilderImpl.java:999)
	at com.intellij.lang.impl.PsiBuilderImpl.buildTree(PsiBuilderImpl.java:911)
	at com.intellij.lang.impl.PsiBuilderImpl.getTreeBuilt(PsiBuilderImpl.java:902)
	at org.jusecase.jte.intellij.language.parsing.JteParser.parse(JteParser.java:19)
	at com.intellij.psi.tree.ILazyParseableElementType.doParseContents(ILazyParseableElementType.java:81)
	at com.intellij.psi.tree.IFileElementType.parseContents(IFileElementType.java:53)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$0(LazyParseableElement.java:192)
	at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:565)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:191)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:242)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:42)
	at com.intellij.psi.impl.BlockSupportImpl.isReplaceWholeNode(BlockSupportImpl.java:377)
	at com.intellij.psi.impl.BlockSupportImpl.mergeTrees(BlockSupportImpl.java:324)
	at com.intellij.psi.impl.BlockSupportImpl.makeFullParse(BlockSupportImpl.java:256)
	at com.intellij.psi.impl.BlockSupportImpl.reparse(BlockSupportImpl.java:88)
	at com.intellij.psi.impl.DocumentCommitThread.doCommit(DocumentCommitThread.java:294)
	at com.intellij.psi.impl.DocumentCommitThread.commitUnderProgress(DocumentCommitThread.java:135)
	at com.intellij.psi.impl.DocumentCommitThread.lambda$commitAsynchronously$0(DocumentCommitThread.java:84)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:508)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$3(NonBlockingReadActionImpl.java:456)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:77)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:153)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:114)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:56)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:170)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:56)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:111)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:77)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:473)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:397)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:215)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:26)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:194)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:207)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:183)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:834)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
casidcommented, Jan 12, 2021

The jte-intellij plugin 1.2.0 was approved by JetBrains and is available with this fix.

1reaction
casidcommented, Nov 15, 2020

That’s very helpful, thanks! I’ll gonna give it a shot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot Cast PsiElement to KtClass
I'm learning to create a plugin for IntelliJ but I'm stuck at PsiElement. I can't cast PsiElement to KtClass even though it also...
Read more >
Cannot Cast PsiElement to KtClass - Intellij - Stack Overflow
I'm learning to create a plugin for IntelliJ but I'm stuck at PsiElement. I can't cast PsiElement to KtClass even though it also...
Read more >
ClassCastException thrown by combination of ktlint and Dokka
The exception message is as follows: java.lang.ClassCastException: org.jetbrains.kotlin.kdoc.psi.impl.KDocImpl cannot be cast to ...
Read more >
jenkinsci/templating-engine-plugin - Gitter
Team, need a small help I am trying to use below configuration but receiving "groovy.lang.MissingPropertyException: No such property: libraries for ...
Read more >
ClassCastException when using Shared Libraries defined in ...
GroovyCastException : Cannot cast object 'com.dohbedoh.example. ... runNextChunk(CpsThread.java:165) at org.jenkinsci.plugins.workflow.cps.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found