ClassNotFound problem
I get classNotFound problem below. The class in the submodule of gradle.
compile project(':blueeyes-shared')
compile project(':source-shared')
java.lang.NoClassDefFoundError: net/kaiba/source/retrofit/ListDanmakus
at net.kaiba.source.actions.DanmakuAnnotationGutterColumnProvider$DanmakuLineAnnotationAspect.getDanmku(DanmakuAnnotationGutterColumnProvider.java:73)
at net.kaiba.source.actions.DanmakuAnnotationGutterColumnProvider$DanmakuLineAnnotationAspect.computeDanmaku(DanmakuAnnotationGutterColumnProvider.java:54)
at net.kaiba.source.actions.DanmakuAnnotationGutterColumnProvider$DanmakuLineAnnotationAspect.<init>(DanmakuAnnotationGutterColumnProvider.java:47)
at net.kaiba.source.actions.DanmakuAnnotationGutterColumnProvider.createColumn(DanmakuAnnotationGutterColumnProvider.java:40)
at net.kaiba.source.actions.AnnotateToggleAction.doAnnotate(AnnotateToggleAction.java:195)
at net.kaiba.source.actions.AnnotateToggleAction.doAnnotate(AnnotateToggleAction.java:90)
at net.kaiba.source.actions.AnnotateToggleAction.doAnnotate(AnnotateToggleAction.java:82)
at net.kaiba.source.actions.AnnotateLocalFileAction$1.onSuccess(AnnotateLocalFileAction.java:151)
at com.intellij.openapi.progress.impl.CoreProgressManager.finishTask(CoreProgressManager.java:507)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.lambda$run$0(CoreProgressManager.java:426)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:312)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:433)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:416)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:399)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
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.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:878)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:827)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:466)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:465)
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: net.kaiba.source.retrofit.ListDanmakus PluginClassLoader[net.kaiba.source, 1.0-SNAPSHOT] com.intellij.ide.plugins.cl.PluginClassLoader@7b8db03e
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:75)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 32 more
Please sign in to leave a comment.
Please link to the full sources of your plugin
But my plugin is not open sourced. I tried to buildPlugin. And I found that the distribution zip does not contains the jar of submodule.
It does work for other plugins, e.g. https://github.com/intellij-rust/intellij-rust
I find out the problem. It does not support submodule to use java-library instead of java. I mean the gradle plugin.
https://docs.gradle.org/current/userguide/java_library_plugin.html
So I think is a bug. It should support java-library. Because java-library comes with implementation and api separation which is require for my submodules to work in my other projects.
Could you please file a feature request https://github.com/JetBrains/gradle-intellij-plugin/ and provide minimal setup project (or describe such setup). Thanks
https://github.com/JetBrains/gradle-intellij-plugin/issues/451
Thanks a lot!