intellij-platform-gradle-plugin
intellij-platform-gradle-plugin copied to clipboard
ZipException: invalid distance too far back during the plugin Unload
What happened?
Hello community! I've registered a DynamicPluginListener:
class ZencoderDynamicPluginListener : DynamicPluginListener { private val logger = Logger.getInstance(ZencoderDynamicPluginListener::class.java) override fun beforePluginUnload(pluginDescriptor: IdeaPluginDescriptor, isUpdate: Boolean) { logger.info("Plugin about to be unloaded: start") Sentry.close() logger.info("Plugin about to be unloaded: ${pluginDescriptor.pluginId}, isUpdate: $isUpdate") } } But everytime I reload the pugin, I'm facing:
Caused by: java.lang.ClassNotFoundException: ai.zencoder.plugin.providers.completion.ZencoderDynamicPluginListener at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.kt:188) at com.intellij.serviceContainer.ComponentManagerImplKt.doLoadClass(ComponentManagerImpl.kt:2255) at com.intellij.serviceContainer.ComponentManagerImpl.createListener(ComponentManagerImpl.kt:1442) ... 55 more Caused by: java.util.zip.ZipException: invalid distance too far back at com.intellij.util.lang.ImmutableZipEntry.getByteBuffer(ImmutableZipEntry.java:149) at com.intellij.util.lang.HashMapZipFile.getByteBuffer(HashMapZipFile.java:99) at com.intellij.util.lang.ZipResourceFile.findClass(ZipResourceFile.java:107) at com.intellij.util.lang.JarLoader.findClass(JarLoader.java:58) at com.intellij.util.lang.ClassPath.findClassInLoader(ClassPath.java:240) at com.intellij.util.lang.ClassPath.findClass(ClassPath.java:190) at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.kt:326) at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.kt:178) I've tried to recreate the class, clean build, move packages to avoid any possibilities of the file corruption, but still didn't succeed. If you have any suggestions, would be appreciated.
Relevant log output or stack trace
Caused by: java.lang.ClassNotFoundException: ai.zencoder.plugin.providers.completion.ZencoderDynamicPluginListener
at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.kt:188)
at com.intellij.serviceContainer.ComponentManagerImplKt.doLoadClass(ComponentManagerImpl.kt:2255)
at com.intellij.serviceContainer.ComponentManagerImpl.createListener(ComponentManagerImpl.kt:1442)
... 55 more
Caused by: java.util.zip.ZipException: invalid distance too far back
at com.intellij.util.lang.ImmutableZipEntry.getByteBuffer(ImmutableZipEntry.java:149)
at com.intellij.util.lang.HashMapZipFile.getByteBuffer(HashMapZipFile.java:99)
at com.intellij.util.lang.ZipResourceFile.findClass(ZipResourceFile.java:107)
at com.intellij.util.lang.JarLoader.findClass(JarLoader.java:58)
at com.intellij.util.lang.ClassPath.findClassInLoader(ClassPath.java:240)
at com.intellij.util.lang.ClassPath.findClass(ClassPath.java:190)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.kt:326)
at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.kt:178)
Steps to reproduce
- Create a simple extension of DynamicPluginListener (example above)
- Register the listener in plugin.xml
- build
- Run the Sandbox:
./gradlew runIde - Perform any changes in the plugin code
- Run
./gradlew buildPlugin - Switch the cursor focus to Sandbox
Gradle IntelliJ Plugin version
2.0.1
Gradle version
8.9
Operating System
macOS
Link to build, i.e. failing GitHub Action job
No response