After upgrading to IDEA 2020.1 it report "java.lang.NoClassDefFoundError: com/intellij/lang/java/JavaLanguage"
已回答
Hi
After we upgraded our plugin code to work with IDEA 2020.1 we are having a issue with "java.lang.NoClassDefFoundError: com/intellij/lang/java/JavaLanguage" when runnning the plugin
The configuration of the gradle intellij plugin :
intellij {
version = '2020.1'
downloadSources = true
type = project.hasProperty('intellij_type') ? project.intellij_type : 'IC'
plugins = ['java', 'java-i18n', 'properties', 'yaml']
}
Our plug-in xml inlude this dependencies :
<depends>com.intellij.modules.xml</depends>
<depends>com.intellij.properties</depends>
<depends>org.jetbrains.plugins.yaml</depends>
java.lang.NoClassDefFoundError: com/intellij/lang/java/JavaLanguage
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2357)
at com.intellij.serviceContainer.ConstructorInjectionKt.getSortedMatchingConstructors(constructorInjection.kt:195)
at com.intellij.serviceContainer.ConstructorInjectionKt.instantiateUsingPicoContainer(constructorInjection.kt:28)
at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClassWithConstructorInjection(ComponentManagerImpl.kt:645)
at com.intellij.serviceContainer.ServiceComponentAdapter.createAndInitialize(ServiceComponentAdapter.kt:54)
at com.intellij.serviceContainer.ServiceComponentAdapter.doCreateInstance(ServiceComponentAdapter.kt:41)
at com.intellij.serviceContainer.BaseComponentAdapter.getInstanceUncached(BaseComponentAdapter.kt:115)
at com.intellij.serviceContainer.BaseComponentAdapter.getInstance(BaseComponentAdapter.kt:69)
at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:396)
at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:379)
at com.intellij.openapi.components.ServiceManager.getService(ServiceManager.java:20)
at com.github.cameltooling.idea.service.CamelService.getIdeaUtils(CamelService.java:87)
at com.github.cameltooling.idea.service.CamelService.addCustomCamelComponentsFromDependency(CamelService.java:445)
at com.github.cameltooling.idea.service.CamelService.scanForCamelDependencies(CamelService.java:375)
at com.github.cameltooling.idea.CamelProjectComponent$2.moduleAdded(CamelProjectComponent.java:109)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:554)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:143)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:472)
at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:432)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:420)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:404)
at com.intellij.util.messages.impl.MessageBusImpl.lambda$createTopicHandler$3(MessageBusImpl.java:243)
at com.sun.proxy.$Proxy62.moduleAdded(Unknown Source)
at com.intellij.openapi.module.impl.ModuleManagerImpl.fireModuleAdded(ModuleManagerImpl.java:416)
at com.intellij.openapi.module.impl.ModuleManagerImpl.lambda$fireModuleAddedInWriteAction$6(ModuleManagerImpl.java:691)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:976)
at com.intellij.openapi.module.impl.ModuleManagerImpl.fireModuleAddedInWriteAction(ModuleManagerImpl.java:688)
at com.intellij.openapi.module.impl.ModuleManagerComponent.fireModulesAdded(ModuleManagerComponent.java:139)
at com.intellij.openapi.module.impl.ModuleManagerImpl.projectOpened(ModuleManagerImpl.java:99)
at com.intellij.openapi.project.impl.ProjectManagerImpl.lambda$null$13(ProjectManagerImpl.java:790)
at com.intellij.ide.startup.impl.StartupManagerImpl.runActivity(StartupManagerImpl.java:458)
at com.intellij.openapi.project.impl.ProjectManagerImpl.lambda$fireProjectOpened$14(ProjectManagerImpl.java:788)
at com.intellij.serviceContainer.ContainerUtilKt.processProjectComponents(containerUtil.kt:31)
at com.intellij.openapi.project.impl.ProjectManagerImpl.fireProjectOpened(ProjectManagerImpl.java:787)
at com.intellij.openapi.project.impl.ProjectManagerImpl.lambda$doLoadProject$6(ProjectManagerImpl.java:455)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeAndWait$8(ApplicationImpl.java:480)
at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:124)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:80)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:128)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:184)
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:974)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:847)
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:496)
at com.intellij.ide.IdeEventQueue.pumpEventsForHierarchy(IdeEventQueue.java:1030)
at com.intellij.openapi.progress.util.ProgressWindow.pumpEventsForHierarchy(ProgressWindow.java:199)
at com.intellij.openapi.progress.util.ProgressWindow.lambda$startBlocking$3(ProgressWindow.java:189)
at com.intellij.openapi.application.impl.ApplicationImpl.runUnlockingIntendedWrite(ApplicationImpl.java:857)
at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:188)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$legacyExec$6(ProgressRunner.java:302)
at java.base/java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:753)
at java.base/java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:731)
at java.base/java.util.concurrent.CompletableFuture.thenAccept(CompletableFuture.java:2108)
at com.intellij.openapi.progress.impl.ProgressRunner.legacyExec(ProgressRunner.java:300)
at com.intellij.openapi.progress.impl.ProgressRunner.submit(ProgressRunner.java:248)
at com.intellij.openapi.progress.impl.ProgressRunner.submitAndGet(ProgressRunner.java:169)
at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:426)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:492)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:84)
at com.intellij.platform.ProjectUiFrameAllocator$run$1.run(ProjectFrameAllocator.kt:85)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeAndWait$8(ApplicationImpl.java:480)
at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:124)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:80)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:128)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:184)
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:974)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:847)
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:496)
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.lang.java.JavaLanguage PluginClassLoader[org.apache.camel, 0.6.4-SNAPSHOT] com.intellij.ide.plugins.cl.PluginClassLoader@6cf1df6e
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:115)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 107 more
Any idea how to solve this ?
Thanks
Flemming
请先登录再写评论。
Flemming,
As I see, you have missed the following dependency in your plugin.xml file:
Thanks Jakub, that solve the problem.
Not sure why it was working in our 2019.x version