Repository navigation
Fix NoClassDefFoundError: CommandProtocol$1 on Paper plugin classloader - #3673
Merged
dmulloy2 merged 1 commit intoOct 6, 2026
Conversation
…ader When BukkitScheduler.runTask() dispatches the update-notify Runnable back onto the main thread, CraftTask.run() executes it under the server's classloader rather than ProtocolLib's PaperPluginClassLoader. Anonymous inner classes compiled as Outer\.class entries are not resolvable through the server classloader, causing: java.lang.NoClassDefFoundError: com/comphenix/protocol/CommandProtocol\ The fix follows the pattern already applied in commit dda284c for SpigotUpdateRunnable: extract the anonymous Runnable from performUpdate() into a named top-level package-private class (UpdateNotifyRunnable) so the runtime always loads a single .class entry through the plugin's own classloader.
dmulloy2
approved these changes
Oct 6, 2026
dmulloy2
enabled auto-merge (squash)
October 6, 2026 22:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When ProtocolLib's update checker runs on Paper 1.19.3+ (and Purpur), the following exception is thrown repeatedly:
java.lang.NoClassDefFoundError: com/comphenix/protocol/CommandProtocol$1
at CommandProtocol.performUpdate(CommandProtocol.java:124)
at CommandProtocol.checkVersion(CommandProtocol.java:94)
at ProtocolLib.checkUpdates(ProtocolLib.java:524)
Caused by: java.lang.ClassNotFoundException: com.comphenix.protocol.CommandProtocol$1
at PaperPluginClassLoader.loadClass(...)
Root cause: performUpdate() creates an anonymous Runnable (compiled as
CommandProtocol$1.class) and registers it as an update listener.
SpigotUpdateRunnable dispatches it back to the main thread via
BukkitScheduler.runTask(). CraftTask.run() executes it under the server's
classloader instead of ProtocolLib's PaperPluginClassLoader — the anonymous
Outer$N class entry is not resolvable through the server classloader.
Fix
Extract the anonymous Runnable into a named top-level package-private class
UpdateNotifyRunnable — the same pattern applied in dda284c for
SpigotUpdateRunnable ("top-level class so the runtime always loads a single
.class entry"). CommandProtocol.java was not updated at that time.
No API changes. Behaviour is identical.