You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After updating to gradle-intellij-plugin 1.6.0, I constantly faced with NoClassDefFoundError exception on test running after new class creation (including creation new lambda since it creates new anonymous class from JVM point of view). 1.7.0-SNAPSHOT version doesn't help so master doesn't contain the corresponding fix.
Using 1.5.3 version helps, but it breaks launching plugin with 2022.2 IDEs.
Test running after clean task helps as well, but it's too slow since it recompiles everything from scratch
I assume it's because of using com.intellij.util.lang.PathClassLoader as system classloader added to 1.6.0
Stacktrace example
com/jetbrains/edu/learning/EduDocumentListenerTest$test type in placeholder$r$1
java.lang.NoClassDefFoundError: com/jetbrains/edu/learning/EduDocumentListenerTest$test type in placeholder$r$1
at com.jetbrains.edu.learning.EduDocumentListenerTest.test type in placeholder(EduDocumentListenerTest.kt:23)
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 junit.framework.TestCase.runTest(TestCase.java:176)
at com.intellij.testFramework.UsefulTestCase.lambda$runBare$11(UsefulTestCase.java:533)
at com.intellij.testFramework.UsefulTestCase.lambda$wrapTestRunnable$13(UsefulTestCase.java:554)
at com.intellij.testFramework.UsefulTestCase.runTestRunnable(UsefulTestCase.java:454)
at com.intellij.testFramework.fixtures.BasePlatformTestCase.runTestRunnable(BasePlatformTestCase.java:106)
at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:470)
at com.intellij.testFramework.UsefulTestCase.lambda$runBare$12(UsefulTestCase.java:541)
at com.intellij.testFramework.EdtTestUtil.lambda$runInEdtAndWait$1(EdtTestUtil.java:40)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
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:740)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:393)
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.jetbrains.edu.learning.EduDocumentListenerTest$test type in placeholder$r$1
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:215)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 27 more
The problem is caused because of the new PathClassLoader introduced for 221+.
When running the instrumentation, by default the classpath.index file is created next to the instrumented classes, however, it doesn't get updated with an incremental run. The previous classloader provided an option for disabling the creation of this file entirely, but now it's not possible.
As a workaround, I'm removing such a file every time the instrumentation task runs, so it gets recreated.
Describe the bug
After updating to gradle-intellij-plugin 1.6.0, I constantly faced with
NoClassDefFoundError
exception on test running after new class creation (including creation new lambda since it creates new anonymous class from JVM point of view).1.7.0-SNAPSHOT
version doesn't help so master doesn't contain the corresponding fix.Using
1.5.3
version helps, but it breaks launching plugin with 2022.2 IDEs.Test running after
clean
task helps as well, but it's too slow since it recompiles everything from scratchI assume it's because of using
com.intellij.util.lang.PathClassLoader
as system classloader added to 1.6.0Stacktrace example
To Reproduce
gradle clean
com.jetbrains.edu.learning.EduDocumentListenerTest#test type in placeholder
test. It should passcom.jetbrains.edu.learning.EduDocumentListenerTest#test type in placeholder
test againExpected behavior
Test passes without
NoClassDefFoundError
Environment:
The text was updated successfully, but these errors were encountered: