Plugin 'AspectJ weaver' failed to initialize "java.lang.NoClassDefFoundError: com/intellij/openapi/compiler/ClassInstrumentingCompiler" - intellij-idea

I'm trying to enable AspectJ Weaver plugin in IntelliJ Idea but I get the following error when the idea restarts and it disables the plugin:
Plugin 'AspectJ weaver' failed to initialize and will be disabled. Please restart IntelliJ IDEA.
java.lang.NoClassDefFoundError: com/intellij/openapi/compiler/ClassInstrumentingCompiler
at java.base/java.lang.ClassLoader.defineClass2(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1109)
at com.intellij.util.lang.UrlClassLoader.consumeClassData(UrlClassLoader.java:290)
at com.intellij.util.lang.ZipResourceFile.findClass(ZipResourceFile.java:116)
at com.intellij.util.lang.JarLoader.findClass(JarLoader.java:55)
at com.intellij.util.lang.ClassPath.findClassInLoader(ClassPath.java:217)
at com.intellij.util.lang.ClassPath.findClass(ClassPath.java:176)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:399)
at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:256)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:232)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
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:194)
at com.intellij.serviceContainer.ConstructorInjectionKt.instantiateUsingPicoContainer(constructorInjection.kt:27)
at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClassWithConstructorInjection(ComponentManagerImpl.kt:876)
at com.intellij.serviceContainer.MyComponentAdapter.doCreateInstance(MyComponentAdapter.kt:35)
at com.intellij.serviceContainer.BaseComponentAdapter.getInstanceUncached(BaseComponentAdapter.kt:113)
at com.intellij.serviceContainer.BaseComponentAdapter.getInstance(BaseComponentAdapter.kt:67)
at com.intellij.serviceContainer.BaseComponentAdapter.getInstance$default(BaseComponentAdapter.kt:60)
at com.intellij.serviceContainer.ComponentManagerImpl.createComponents(ComponentManagerImpl.kt:401)
at com.intellij.openapi.project.impl.ProjectExImpl.init(ProjectExImpl.kt:180)
at com.intellij.openapi.project.impl.ProjectManagerImpl.initProject(ProjectManagerImpl.java:179)
at com.intellij.openapi.project.impl.ProjectManagerExImpl.prepareProject(ProjectManagerExImpl.kt:272)
at com.intellij.openapi.project.impl.ProjectManagerExImpl.access$prepareProject(ProjectManagerExImpl.kt:59)
at com.intellij.openapi.project.impl.ProjectManagerExImpl$doOpenAsync$1.invoke(ProjectManagerExImpl.kt:121)
at com.intellij.openapi.project.impl.ProjectManagerExImpl$doOpenAsync$1.invoke(ProjectManagerExImpl.kt:59)
at com.intellij.openapi.project.impl.ProjectUiFrameAllocator$run$progressRunner$1.apply(ProjectFrameAllocator.kt:94)
at com.intellij.openapi.project.impl.ProjectUiFrameAllocator$run$progressRunner$1.apply(ProjectFrameAllocator.kt:71)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.ClassNotFoundException: com.intellij.openapi.compiler.ClassInstrumentingCompiler PluginClassLoader(plugin=PluginDescriptor(name=AspectJ weaver, id=AspectJ weaver, descriptorPath=plugin.xml, path=~\AppData\Roaming\JetBrains\IntelliJIdea2021.3\plugins\aspectjweaver, version=3.0.0, package=null, isBundled=false), packagePrefix=null, instanceId=193, state=active)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:235)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 46 more
I uninstalled the program and reinstalled it again but the problem is not fixed. Anyone has an solution to fix the problem? Thanks.

If you are talking about this plugin, its last update is from 2013 for IntelliJ 12. You want the original AspectJ plugin from JetBrains.

Related

ForgeGradle actions causing IntelliJ to crash

The gradle process fails when I tried to build or sync my Forge mod written in Kotlin with IntelliJ
The way to find any output is from the logs:
[ 34623] WARN - #c.a.t.i.g.p.s.GradleSyncState - No error message given
java.lang.IllegalStateException: No error message given
at com.android.tools.idea.gradle.project.sync.GradleSyncState.syncFailed(GradleSyncState.kt:235)
at com.android.tools.idea.gradle.project.sync.GradleSyncState.access$syncFailed(GradleSyncState.kt:88)
at com.android.tools.idea.gradle.project.sync.GradleSyncState$SyncStateUpdater.onEvent(GradleSyncState.kt:506)
at com.intellij.build.AbstractViewManager.onEvent(AbstractViewManager.java:116)
at com.intellij.openapi.externalSystem.service.execution.AbstractOutputMessageDispatcher$onEvent$1.accept(AbstractOutputMessageDispatcher.kt:21)
at com.intellij.openapi.externalSystem.service.execution.AbstractOutputMessageDispatcher$onEvent$1.accept(AbstractOutputMessageDispatcher.kt:14)
at com.intellij.openapi.externalSystem.service.execution.AbstractOutputMessageDispatcher$close$1.accept(AbstractOutputMessageDispatcher.kt:41)
at com.intellij.openapi.externalSystem.service.execution.AbstractOutputMessageDispatcher$close$1.accept(AbstractOutputMessageDispatcher.kt:14)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
at com.intellij.build.output.BuildOutputInstantReaderImpl$readerRunnable$1.run(BuildOutputInstantReaderImpl.kt:78)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:212)
at com.intellij.util.ConcurrencyUtil.lambda$underThreadNameRunnable$3(ConcurrencyUtil.java:200)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
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:829)
I am on the latest version of ubuntu, and have tried deleting the .gradle folder, invalidating caches, and re-downloading the project.
Thank You for helping
I got it fixed, I had my system java version set to java 17, rather than java 8. after I changed the alternate and deleted my .gradle folder it worked

Self contained Kotlin/Gradle project produces java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics

Can anyone help me please? I need to setup a completely offline IntelliJ project with gradle and kotlin for our constrained school environment (No Kotlin installed, No Gradle installed, No Internet).
I packed all kotlin dependencies into libs/kotlin but it still tells me, that kotlin.jvm.internal.Intrinsics is not found. You can find the repo here:
Could not perform incremental compilation: Could not connect to Kotlin compile daemon
Could not connect to kotlin daemon. Using fallback strategy.
Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler$Companion.main(K2JVMCompiler.kt)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.main(K2JVMCompiler.kt)
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
... 2 more
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
You can checkout the repo here:
https://github.com/emign/kotlinOfflineTest

Error while using JUnit5 with spring boot 2

I am getting following error while running JUnit5 with SpringBoot.
Here is the stack trace that I get when I run
./gradlew clean test
:junitPlatformTest
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/util/ReflectionUtil
at org.apache.logging.log4j.jul.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:34)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
at org.apache.logging.log4j.jul.LogManager.getLogger(LogManager.java:89)
at java.util.logging.LogManager.demandLogger(LogManager.java:551)
at java.util.logging.Logger.demandLogger(Logger.java:455)
at java.util.logging.Logger.getLogger(Logger.java:502)
at org.junit.platform.commons.logging.LoggerFactory$DelegatingLogger.<init>(LoggerFactory.java:62)
at org.junit.platform.commons.logging.LoggerFactory.getLogger(LoggerFactory.java:49)
at org.junit.platform.launcher.core.DefaultLauncher.<clinit>(DefaultLauncher.java:44)
at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:59)
at org.junit.platform.console.tasks.ConsoleTestExecutor.executeTests(ConsoleTestExecutor.java:61)
at org.junit.platform.console.tasks.ConsoleTestExecutor.lambda$execute$0(ConsoleTestExecutor.java:57)
at org.junit.platform.console.tasks.CustomContextClassLoaderExecutor.invoke(CustomContextClassLoaderExecutor.java:33)
at org.junit.platform.console.tasks.ConsoleTestExecutor.execute(ConsoleTestExecutor.java:57)
at org.junit.platform.console.ConsoleLauncher.executeTests(ConsoleLauncher.java:85)
at org.junit.platform.console.ConsoleLauncher.execute(ConsoleLauncher.java:75)
at org.junit.platform.console.ConsoleLauncher.execute(ConsoleLauncher.java:48)
at org.junit.platform.console.ConsoleLauncher.main(ConsoleLauncher.java:40)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.util.ReflectionUtil
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 18 more
The github url for above code is github link
This is caused by mixing different versions of Log4J on the test runtime classpath. Spring Boot pulls in 2.10.0, your build.gradle declares 2.6.2.
If you remove the version from your dependency definition, Spring Boot will define the version and it will work.
So, please replace these two lines
testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}")
testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}")
with these:
testRuntime("org.apache.logging.log4j:log4j-core")
testRuntime("org.apache.logging.log4j:log4j-jul")
Alternatively, you can delete the logManager property from the junitPlatform extension and remove both dependencies.

ClassNotFoundException when using the Mule Amazon SQS connector

I'm using the Amazon SQS connector in my Mule project. When I updated it from the 2.5.5 to the 3.0.0 version according to the user guide and set the DEBUG logging level for the com.amazonaws package I noticed the following error right after project starts:
DEBUG 2015-07-20 15:15:56,927 [Receiving Thread] com.amazonaws.1.9.39.shade.jmx.spi.SdkMBeanRegistry: Failed to load the JMX implementation module - JMX is disabled
java.lang.ClassNotFoundException: com.amazonaws.1.9.39.shade.jmx.SdkMBeanRegistrySupport
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.mule.module.launcher.FineGrainedControlClassLoader.findClass(FineGrainedControlClassLoader.java:175)
at org.mule.module.launcher.MuleApplicationClassLoader.findClass(MuleApplicationClassLoader.java:134)
at org.mule.module.launcher.FineGrainedControlClassLoader.loadClass(FineGrainedControlClassLoader.java:119)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.amazonaws.1.9.39.shade.jmx.spi.SdkMBeanRegistry$Factory.<clinit>(SdkMBeanRegistry.java:46)
at com.amazonaws.1.9.39.shade.metrics.AwsSdkMetrics.registerMetricAdminMBean(AwsSdkMetrics.java:351)
at com.amazonaws.1.9.39.shade.metrics.AwsSdkMetrics.<clinit>(AwsSdkMetrics.java:316)
at com.amazonaws.1.9.39.shade.AmazonWebServiceClient.requestMetricCollector(AmazonWebServiceClient.java:629)
at com.amazonaws.1.9.39.shade.AmazonWebServiceClient.isRMCEnabledAtClientOrSdkLevel(AmazonWebServiceClient.java:570)
at com.amazonaws.1.9.39.shade.AmazonWebServiceClient.isRequestMetricsEnabled(AmazonWebServiceClient.java:562)
at com.amazonaws.1.9.39.shade.AmazonWebServiceClient.createExecutionContext(AmazonWebServiceClient.java:523)
at com.amazonaws.1.9.39.shade.services.sqs.AmazonSQSClient.listQueues(AmazonSQSClient.java:1163)
at com.amazonaws.1.9.39.shade.services.sqs.AmazonSQSClient.listQueues(AmazonSQSClient.java:1501)
at org.mule.modules.sqs.connection.strategy.SQSConnectionManagement.connect(SQSConnectionManagement.java:173)
at org.mule.modules.sqs.connectivity.SQSConnectionManagementSQSConnectorAdapter.connect(SQSConnectionManagementSQSConnectorAdapter.java:21)
at org.mule.modules.sqs.connectivity.SQSConnectionManagementSQSConnectorAdapter.connect(SQSConnectionManagementSQSConnectorAdapter.java:9)
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementConnectorFactory.makeObject(ConnectionManagementConnectorFactory.java:47)
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementConnectorFactory.makeObject(ConnectionManagementConnectorFactory.java:15)
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
at org.mule.modules.sqs.connectivity.SQSConnectorConfigConnectionManagementConnectionManager.acquireConnection(SQSConnectorConfigConnectionManagementConnectionManager.java:407)
at org.mule.modules.sqs.connectivity.SQSConnectorConfigConnectionManagementConnectionManager.acquireConnection(SQSConnectorConfigConnectionManagementConnectionManager.java:55)
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementProcessInterceptor.execute(ConnectionManagementProcessInterceptor.java:47)
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementProcessInterceptor.execute(ConnectionManagementProcessInterceptor.java:19)
at org.mule.security.oauth.process.RetryProcessInterceptor.execute(RetryProcessInterceptor.java:84)
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementProcessTemplate.execute(ConnectionManagementProcessTemplate.java:33)
at org.mule.modules.sqs.sources.ReceiveMessagesMessageSource.run(ReceiveMessagesMessageSource.java:134)
at java.lang.Thread.run(Thread.java:662)
It's true, the mule-module-sqs-3.0.0.jar downloaded by Maven doesn't contain such class. I rebuild the Amazon SQS connector's source code with little changes in the pom.xml: set <minimizeJar>false</minimizeJar> for the maven-shade-plugin. Then the missing class appeared in the jar and I managed to run the project without errors.
Not sure is it a bug or not but don't like the idea to build the connector manually. Will really appreciate if you help me to sort it out. Thanks.

Jboss6EAP java.lang.NoSuchMethodError: org.springframework.beans.factory.config.ConfigurableListableBeanFactory.registerResolvableDependency

I am moving a simple web application from Jboss 4.3 to Jboss 6 EAP (Jboss AS 7.2). However, I am unable to deploy the war because of the error
07:43:17,773 ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 63) Context initialization failed: java.lang.NoSuchMethodError: org.springframework.beans.factory.config.ConfigurableListableBeanFactory.registerResolvableDependency(Ljava/lang/Class;Ljava/lang/Object;)V
at org.springframework.context.support.AbstractApplicationContext.prepareBeanFactory(AbstractApplicationContext.java:458) [spring-2.5.5.jar:2.5.5]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:356) [spring-2.5.5.jar:2.5.5]
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) [spring-2.5.5.jar:2.5.5]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) [spring-2.5.5.jar:2.5.5]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) [spring-2.5.5.jar:2.5.5]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.7.0_60]
at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_60]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_60]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
I am not sure what needs to be done. The Spring libraries the war file uses is version 2.5.5 and is bundled within the war 0 within the WEB-INF/lib directory.
Any help in resolving my problem, would be much appreciated. Thanks.
I was able to solve this issue. Would like to share with others, in case they run into the same issue. The war file we were using had Spring libraries and was included within the war file.
The problem was with the versions of the spring.jar and spring-context.jar. The former was 2.0.3 but the latter was version 2.5.5. I downgraded the spring-context.jar to 2.0.3 and it did the trick.
Not sure, why there was no problem in Jboss 4.3. Anyway, I don't have the problem now.
I would like to add that this problem could persist - after clearing out the dependencies (using exclusions), there could still be a wrong version in the Eclipse classpath.
You can figure this out running f.ex. a test with two methods:
in Eclipse
using Maven
mvn clean test -Dtest=com.example.HelloTest
Compare error messages / the stack traces, they might be different, or the Maven test runs fine while in Eclipse the test fails.