Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Exception on startup: NoSuchMethodError: org.bukkit.Statistic.getKey() #137

Closed
devsjay opened this issue Jan 24, 2022 · 4 comments

Comments

@devsjay
Copy link

devsjay commented Jan 24, 2022

[10:40:50 ERROR]: Error occurred while enabling PrometheusExporter v2.4.2 (Is it up to date?)
java.lang.NoSuchMethodError: org.bukkit.Statistic.getKey()Lorg/bukkit/NamespacedKey;
        at de.sldk.mc.metrics.player.PlayerStatisticLoaderFromFile.lambda$static$0(PlayerStatisticLoaderFromFile.java:37) ~[?:?]
        at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1320) ~[?:1.8.0_312]
        at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) ~[?:1.8.0_312]
        at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[?:1.8.0_312]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_312]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_312]
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_312]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_312]
        at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_312]
        at de.sldk.mc.metrics.player.PlayerStatisticLoaderFromFile.<clinit>(PlayerStatisticLoaderFromFile.java:37) ~[?:?]
        at de.sldk.mc.metrics.PlayerStatistics.<init>(PlayerStatistics.java:40) ~[?:?]
        at de.sldk.mc.config.MetricConfig.getMetric(MetricConfig.java:20) ~[?:?]
        at de.sldk.mc.config.PrometheusExporterConfig.lambda$enableConfiguredMetrics$1(PrometheusExporterConfig.java:62) ~[?:?]
        at java.util.Arrays$ArrayList.forEach(Arrays.java:3880) ~[?:1.8.0_312]
        at de.sldk.mc.config.PrometheusExporterConfig.enableConfiguredMetrics(PrometheusExporterConfig.java:61) ~[?:?]
        at de.sldk.mc.PrometheusExporter.onEnable(PrometheusExporter.java:18) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[server.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [server.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [server.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [server.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [server.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414) [server.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378) [server.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333) [server.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263) [server.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [server.jar:git-Spigot-21fe707-741a1bd]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312]
@devsjay
Copy link
Author

devsjay commented Jan 24, 2022

1.181.1

@sladkoff sladkoff changed the title [Bug Report] [Bug Report] Exception on startup: NoSuchMethodError: org.bukkit.Statistic.getKey() Apr 11, 2022
@sladkoff sladkoff added the bug label Apr 11, 2022
@sdjnmxd
Copy link

sdjnmxd commented May 31, 2023

I also encountered a similar problem to this, maybe both problems are the same cause.

On the Spigot download page of the plug-in, I saw that there is a problem with Java 1.8 version. I would like to ask if this is the reason?

ErrorLog
[19:38:30 ERROR]: Error occurred while enabling PrometheusExporter v2.5.0 (Is it up to date?)
java.lang.NoSuchMethodError: org.bukkit.Statistic.getKey()Lorg/bukkit/NamespacedKey;
      at de.sldk.mc.metrics.player.PlayerStatisticLoaderFromFile.lambda$static$0(PlayerStatisticLoaderFromFile.java:41) ~[?:?]
      at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1320) ~[?:1.8.0_372]
      at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) ~[?:1.8.0_372]
      at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[?:1.8.0_372]
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_372]
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_372]
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_372]
      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_372]
      at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_372]
      at de.sldk.mc.metrics.player.PlayerStatisticLoaderFromFile.<clinit>(PlayerStatisticLoaderFromFile.java:41) ~[?:?]
      at de.sldk.mc.metrics.PlayerStatistics.<init>(PlayerStatistics.java:40) ~[?:?]
      at de.sldk.mc.config.MetricConfig.getMetric(MetricConfig.java:20) ~[?:?]
      at de.sldk.mc.config.PrometheusExporterConfig.lambda$enableConfiguredMetrics$1(PrometheusExporterConfig.java:63) ~[?:?]
      at java.util.Arrays$ArrayList.forEach(Arrays.java:3880) ~[?:1.8.0_372]
      at de.sldk.mc.config.PrometheusExporterConfig.enableConfiguredMetrics(PrometheusExporterConfig.java:62) ~[?:?]
      at de.sldk.mc.PrometheusExporter.onEnable(PrometheusExporter.java:18) ~[?:?]
      at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:177) ~[JavaPlugin.class:?]
      at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:318) [JavaPluginLoader.class:?]
      at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:399) [SimplePluginManager.class:?]
      at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:477) [CraftServer.class:?]
      at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:418) [CraftServer.class:?]
      at net.minecraft.server.MinecraftServer.loadAllWorlds(MinecraftServer.java:383) [MinecraftServer.class:?]
      at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:315) [nz.class:?]
      at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:590) [MinecraftServer.class:?]
      at java.lang.Thread.run(Thread.java:750) [?:1.8.0_372]

The system distribution I use

cat /etc/redhat-release
Rocky Linux release 8.6 (Green Obsidian)

The Java version used to run the server is

java -version
openjdk version "1.8.0_372"
OpenJDK Runtime Environment (build 1.8.0_372-b07)
OpenJDK 64-Bit Server VM (build 25.372-b07, mixed mode)

Server implementation and game version

mohist-1.12.2-311-server.jar

@sladkoff
Copy link
Owner

@devsjay @sdjnmxd Java 8 is not really supported by this plugin anymore. There are other known issues like #161. I will update the readme accordingly.

Can you verify if you have the same issues with Java 11 or 17?

@sladkoff
Copy link
Owner

sladkoff commented Jan 3, 2024

Please feel free to re-open if this persists on newer Java versions.

@sladkoff sladkoff closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants