General information
Sonar fails to enable on BungeeCord with the following exception:
Exception encountered when loading plugin: Sonar
java.lang.NoSuchMethodError:
'java.util.Optional xyz.jonesdev.sonar.libs.kyori.adventure.util.Services.service(java.util.ServiceLoader, java.lang.Class)'
at xyz.jonesdev.sonar.libs.kyori.adventure.text.minimessage.MiniMessageImpl.(MiniMessageImpl.java:51)
at xyz.jonesdev.sonar.libs.kyori.adventure.text.minimessage.MiniMessage.miniMessage(MiniMessage.java:59)
at xyz.jonesdev.sonar.api.config.SonarConfiguration.loadValues(SonarConfiguration.java:244)
at xyz.jonesdev.sonar.common.boot.SonarBootstrap.initialize(SonarBootstrap.java:104)
at xyz.jonesdev.sonar.bungee.SonarBungeePlugin.onEnable(SonarBungeePlugin.java:34)
at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:375)
at net.md_5.bungee.BungeeCord.start(BungeeCord.java:339)
I enabled JVM class-loading logging to verify the source of the conflicting classes.
The Services class is loaded from Sonar-Bungee.jar:
xyz.jonesdev.sonar.libs.kyori.adventure.util.Services
source: file:/home/container/plugins/Sonar-Bungee.jar
However, MiniMessageImpl is loaded from Sonar's dynamically downloaded Adventure 5.2.0 library:
xyz.jonesdev.sonar.libs.kyori.adventure.text.minimessage.MiniMessageImpl
source: file:/home/container/plugins/Sonar/lib/net/kyori/adventure-text-minimessage/5.2.0/adventure-text-minimessage-5.2.0.jar-relocated-1242254762.jar
Adventure 5.2.0 MiniMessage expects Services.service(ServiceLoader, Class), but the Services class loaded from Sonar-Bungee.jar does not provide that method.
This appears to be an Adventure dependency/version conflict inside Sonar's relocated xyz.jonesdev.sonar.libs.kyori namespace.
Expected behavior:
Sonar should enable normally on BungeeCord.
Actual behavior:
Sonar fails during initialization with NoSuchMethodError.
Steps to reproduce
- Install the current Sonar-Bungee.jar on a BungeeCord-compatible proxy.
- Start the proxy with Sonar installed.
- Sonar downloads its Adventure 5.2.0 runtime libraries into plugins/Sonar/lib/.
- During initialization, xyz.jonesdev.sonar.libs.kyori.adventure.util.Services is loaded from Sonar-Bungee.jar.
- MiniMessageImpl is then loaded from the dynamically downloaded adventure-text-minimessage-5.2.0 JAR.
- MiniMessageImpl attempts to call Services.service(ServiceLoader, Class).
- Sonar fails to enable with java.lang.NoSuchMethodError.
The issue is reproducible after a full proxy restart and does not involve plugin reloading.
Sonar dump
A /sonar dump cannot be generated because Sonar fails during onEnable() before the plugin becomes usable.
The startup exception is:
java.lang.NoSuchMethodError:
'java.util.Optional xyz.jonesdev.sonar.libs.kyori.adventure.util.Services.service(java.util.ServiceLoader, java.lang.Class)'
If there is another way to generate a Sonar dump while the plugin fails during startup, I can provide it.
Additional information
JVM class-loading diagnostics confirm the conflict.
Services is loaded from:
xyz.jonesdev.sonar.libs.kyori.adventure.util.Services
source: file:/home/container/plugins/Sonar-Bungee.jar
MiniMessageImpl is loaded from:
xyz.jonesdev.sonar.libs.kyori.adventure.text.minimessage.MiniMessageImpl
source: file:/home/container/plugins/Sonar/lib/net/kyori/adventure-text-minimessage/5.2.0/adventure-text-minimessage-5.2.0.jar-relocated-1242254762.jar
The current Bungee module uses adventure-platform-bungeecord 4.4.1 and relocates net.kyori into xyz.jonesdev.sonar.libs.kyori, while Sonar dynamically loads Adventure 5.2.0 libraries into the same relocated namespace.
This appears to result in incompatible Adventure classes being mixed at runtime.
PacketEvents and other installed plugins use different package namespaces and are not supplying the xyz.jonesdev.sonar.libs.kyori.* classes involved in this exception.
I can also provide the full JVM class-loading log if needed.
General information
Sonar fails to enable on BungeeCord with the following exception:
Exception encountered when loading plugin: Sonar
java.lang.NoSuchMethodError:
'java.util.Optional xyz.jonesdev.sonar.libs.kyori.adventure.util.Services.service(java.util.ServiceLoader, java.lang.Class)'
at xyz.jonesdev.sonar.libs.kyori.adventure.text.minimessage.MiniMessageImpl.(MiniMessageImpl.java:51)
at xyz.jonesdev.sonar.libs.kyori.adventure.text.minimessage.MiniMessage.miniMessage(MiniMessage.java:59)
at xyz.jonesdev.sonar.api.config.SonarConfiguration.loadValues(SonarConfiguration.java:244)
at xyz.jonesdev.sonar.common.boot.SonarBootstrap.initialize(SonarBootstrap.java:104)
at xyz.jonesdev.sonar.bungee.SonarBungeePlugin.onEnable(SonarBungeePlugin.java:34)
at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:375)
at net.md_5.bungee.BungeeCord.start(BungeeCord.java:339)
I enabled JVM class-loading logging to verify the source of the conflicting classes.
The Services class is loaded from Sonar-Bungee.jar:
xyz.jonesdev.sonar.libs.kyori.adventure.util.Services
source: file:/home/container/plugins/Sonar-Bungee.jar
However, MiniMessageImpl is loaded from Sonar's dynamically downloaded Adventure 5.2.0 library:
xyz.jonesdev.sonar.libs.kyori.adventure.text.minimessage.MiniMessageImpl
source: file:/home/container/plugins/Sonar/lib/net/kyori/adventure-text-minimessage/5.2.0/adventure-text-minimessage-5.2.0.jar-relocated-1242254762.jar
Adventure 5.2.0 MiniMessage expects Services.service(ServiceLoader, Class), but the Services class loaded from Sonar-Bungee.jar does not provide that method.
This appears to be an Adventure dependency/version conflict inside Sonar's relocated xyz.jonesdev.sonar.libs.kyori namespace.
Expected behavior:
Sonar should enable normally on BungeeCord.
Actual behavior:
Sonar fails during initialization with NoSuchMethodError.
Steps to reproduce
The issue is reproducible after a full proxy restart and does not involve plugin reloading.
Sonar dump
A /sonar dump cannot be generated because Sonar fails during onEnable() before the plugin becomes usable.
The startup exception is:
java.lang.NoSuchMethodError:
'java.util.Optional xyz.jonesdev.sonar.libs.kyori.adventure.util.Services.service(java.util.ServiceLoader, java.lang.Class)'
If there is another way to generate a Sonar dump while the plugin fails during startup, I can provide it.
Additional information
JVM class-loading diagnostics confirm the conflict.
Services is loaded from:
xyz.jonesdev.sonar.libs.kyori.adventure.util.Services
source: file:/home/container/plugins/Sonar-Bungee.jar
MiniMessageImpl is loaded from:
xyz.jonesdev.sonar.libs.kyori.adventure.text.minimessage.MiniMessageImpl
source: file:/home/container/plugins/Sonar/lib/net/kyori/adventure-text-minimessage/5.2.0/adventure-text-minimessage-5.2.0.jar-relocated-1242254762.jar
The current Bungee module uses adventure-platform-bungeecord 4.4.1 and relocates net.kyori into xyz.jonesdev.sonar.libs.kyori, while Sonar dynamically loads Adventure 5.2.0 libraries into the same relocated namespace.
This appears to result in incompatible Adventure classes being mixed at runtime.
PacketEvents and other installed plugins use different package namespaces and are not supplying the xyz.jonesdev.sonar.libs.kyori.* classes involved in this exception.
I can also provide the full JVM class-loading log if needed.