Paper: Plugin class loader problem when javacord shaded

Created on 17 Apr 2019  路  5Comments  路  Source: PaperMC/Paper

What behaviour is expected:

Plugin load without any problems.

What behaviour is observed:

[17:26:09 ERROR]: [ServerSuggestions] Error occurred trying to login java.util.concurrent.CompletionException: java.lang.IllegalStateException: zip file closed at java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source) ~[?:1.8.0_202] at java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source) ~[?:1.8.0_202] at java.util.concurrent.CompletableFuture.uniAccept(Unknown Source) ~[?:1.8.0_202] at java.util.concurrent.CompletableFuture$UniAccept.tryFire(Unknown Source) ~[?:1.8.0_202] at java.util.concurrent.CompletableFuture.postComplete(Unknown Source) ~[?:1.8.0_202] at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source) ~[?:1.8.0_202] at org.javacord.core.DiscordApiImpl.lambda$new$7(DiscordApiImpl.java:520) ~[?:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_202] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_202] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_202] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_202] at java.lang.Thread.run(Unknown Source) [?:1.8.0_202] Caused by: java.lang.IllegalStateException: zip file closed at java.util.zip.ZipFile.ensureOpen(Unknown Source) ~[?:1.8.0_202] at java.util.zip.ZipFile.getEntry(Unknown Source) ~[?:1.8.0_202] at java.util.jar.JarFile.getEntry(Unknown Source) ~[?:1.8.0_202] at java.util.jar.JarFile.getJarEntry(Unknown Source) ~[?:1.8.0_202] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:102) ~[patched_1.13.2.jar:git-Paper-621] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[patched_1.13.2.jar:git-Paper-621] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_202] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_202] at org.javacord.core.DiscordApiImpl.lambda$new$7(DiscordApiImpl.java:481) ~[?:?] ... 5 more

Steps/models to reproduce:

When loading my plugin

Plugin list:

ServerSuggestions which is my plugin.

Paper build number:

621

Anything else:

This is not a javacord issue since the plugin is loaded on spigot without any problems.

Most helpful comment

we're blocking async tasks when they're not ran by the bukkit scheduler so you use bukkit scheduler you b*tch

You can't even avoid being edgy in issue tracker, lol

All 5 comments

Can you include a simplified plugin jar file that has this issue, for testing?

This occurs if you have stuff running after a plugin has been disabled. You are responsible for ensuring async tasks that were not scheduled using the bukkit scheduler to block onDisable until they finish.

This looks like you used /reload and had an async task running and it tried to access the original closed jar.

I don't think this error came from your load, but simply printed from your previous load when reloading.

Can you include a simplified plugin jar file that has this issue, for testing?

I have another issue with a npe when i use their api, but thats plugin specific. Here: https://bit.ly/2XhsnM5
EDIT: You should set the bot up (create a bot user and set its token) in the config or else the plugin will disable.

This occurs if you have stuff running after a plugin has been disabled. You are responsible for ensuring async tasks that were not scheduled using the bukkit scheduler to block onDisable until they finish.

This looks like you used /reload and had an async task running and it tried to access the original closed jar.

I don't think this error came from your load, but simply printed from your previous load when reloading.

The plugin is not disabled and i did not ran /reload at all. I can upload src of the plugin if u want to.

You are responsible for ensuring async tasks that were not scheduled using the bukkit scheduler to block onDisable until they finish.

Translated: we're blocking async tasks when they're not ran by the bukkit scheduler so you use bukkit scheduler you b*tch. When i did it sync without the javacord's async it worked. Thanks for the "help". Closed.

we're blocking async tasks when they're not ran by the bukkit scheduler so you use bukkit scheduler you b*tch

You can't even avoid being edgy in issue tracker, lol

Was this page helpful?
0 / 5 - 0 ratings