cann't find PsiClassOwner

Answered

A plug-in I wrote two years ago can work normally, but after I updated it, an error is now reported.

I did not find a similar solution available online

 

2020-09-01 16:55:18,500 [ 59716] ERROR - llij.ide.plugins.PluginManager - com/intellij/psi/PsiClassOwner 
java.lang.NoClassDefFoundError: com/intellij/psi/PsiClassOwner
at com.gelonggld.db2bkg.utils.codeparse.FileDispatch.findClass(FileDispatch.kt:41)
at com.gelonggld.db2bkg.utils.codeparse.FileDispatch.dispatchFindTargetTable(FileDispatch.kt:29)
at com.gelonggld.db2bkg.dialogs.CheckDialog.proessSingleFile(CheckDialog.kt:241)
at com.gelonggld.db2bkg.dialogs.CheckDialog.allTables(CheckDialog.kt:232)
at com.gelonggld.db2bkg.dialogs.CheckDialog.proessSingleFile(CheckDialog.kt:239)
at com.gelonggld.db2bkg.dialogs.CheckDialog.allTables(CheckDialog.kt:232)
at com.gelonggld.db2bkg.dialogs.CheckDialog.showCreateBeanDialog(CheckDialog.kt:124)
at com.gelonggld.db2bkg.dialogs.CheckDialog.processDBConnect(CheckDialog.kt:97)
at com.gelonggld.db2bkg.dialogs.CheckDialog.onOK(CheckDialog.kt:181)
at com.gelonggld.db2bkg.dialogs.CheckDialog.access$onOK(CheckDialog.kt:26)
at com.gelonggld.db2bkg.dialogs.CheckDialog$initOk$1.actionPerformed(CheckDialog.kt:159)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:270)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6651)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
at java.desktop/java.awt.Component.processEvent(Component.java:6416)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:974)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:912)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:844)
at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:449)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:728)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
at java.desktop/java.awt.Dialog.show(Dialog.java:1063)
at java.desktop/java.awt.Component.show(Component.java:1734)
at java.desktop/java.awt.Component.setVisible(Component.java:1681)
at java.desktop/java.awt.Window.setVisible(Window.java:1031)
at java.desktop/java.awt.Dialog.setVisible(Dialog.java:998)
at com.gelonggld.db2bkg.EntryAction.actionPerformed(EntryAction.kt:17)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:280)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:296)
at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:281)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:77)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:285)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:112)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:112)
at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:517)
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:36)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:539)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6651)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
at java.desktop/java.awt.Component.processEvent(Component.java:6416)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:974)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:912)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:844)
at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:449)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:739)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: com.intellij.psi.PsiClassOwner PluginClassLoader[top.gelonggld.db2bkt, 1.0-SNAPSHOT] com.intellij.ide.plugins.cl.PluginClassLoader@1a9ddeb7
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:115)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 112 more
Caused by: java.lang.ClassNotFoundException: com.intellij.psi.PsiClassOwner PluginClassLoader[top.gelonggld.db2bkt, 1.0-SNAPSHOT] com.intellij.ide.plugins.cl.PluginClassLoader@1a9ddeb7

2020-09-01 16:55:18,508 [ 59724] ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA 2020.1 Build #IC-201.6668.121
2020-09-01 16:55:18,508 [ 59724] ERROR - llij.ide.plugins.PluginManager - JDK: 11.0.6; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2020-09-01 16:55:18,508 [ 59724] ERROR - llij.ide.plugins.PluginManager - OS: Windows 10
2020-09-01 16:55:18,509 [ 59725] ERROR - llij.ide.plugins.PluginManager - Plugin to blame: dbcompareKG version: 1.0-SNAPSHOT
2020-09-01 16:55:18,509 [ 59725] ERROR - llij.ide.plugins.PluginManager - Last Action: db2bkg

This is the code

if (psiFile is PsiClassOwner) {
if (psiFile.classes.isEmpty()) {
return null
}
return psiFile.classes[0]
}

and this is the build.gradle

plugins {
id 'java'
id 'org.jetbrains.intellij' version '0.4.21'
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
}

group 'top.gelonggld'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
runtime 'mysql:mysql-connector-java:8.0.11'
runtime 'org.mariadb.jdbc:mariadb-java-client:2.2.5'

testCompile group: 'junit', name: 'junit', version: '4.12'
}

// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version '2020.1'
plugins 'java','Kotlin'

}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
patchPluginXml {
changeNotes """
add annotation.<br>
<em>most HTML tags may be used</em>
"""
}

thanks

 

 

 
3 comments
Comment actions Permalink

According to what you said, I added a dependency to the plugin to solve this problem. This is my plugin.xml

<idea-plugin>
<id>top.gelonggld.db2bkt</id>
<name>dbcompareKG</name>
<vendor email="gelonggld@qq.com" url="http://www.gelonggld.top">notCompany</vendor>

<description> Compare databases and model Support mysql/oracle/mariadb, parse java/kotlin, can automatically generate dao.service information based on tables, compare model based on tables, and compare tables based on model/比较数据库和对象 支持mysql/oracle, 解析java/kotlin,可以根据表自动生成dao.service信息,可以根据表比较对象,可以根据对象比较表</description>

<depends>com.intellij.modules.platform</depends>
<depends>com.intellij.modules.java</depends>
<extensions defaultExtensionNs="com.intellij">
<!-- Add your extensions here -->
</extensions>

<actions>
<action class="com.gelonggld.db2bkg.EntryAction" id="db2bkg" text="db2b" description="对象数据库比较">
<add-to-group group-id="NewGroup" anchor="last"/>
</action>
</actions>
</idea-plugin>

But now there are other classes not found,

java.lang.NoClassDefFoundError: org/jetbrains/kotlin/asJava/classes/KtLightClass

This is my code

if (psiclass is KtLightClass) {
return ktWorker.findTargetTable(psiclass,annoStr,tableNameSign)
}else{
return jaWorker.findTargetTable(psiclass,annoStr,tableNameSign)
}

I want to add <depends> to plugin.xml like the previous question, but I did not find any <depends> about kotlin

 

0
Comment actions Permalink

I found it from other people's code on github

<depends>org.jetbrains.kotlin</depends>

The problem has been solved

1

Please sign in to leave a comment.