question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No Such Method Error when shading the plugin into my own plugin

See original GitHub issue
java.lang.NoSuchMethodError: org.bukkit.Server.getOnlinePlayers()[Lorg/bukkit/entity/Player;
	at com.comphenix.tinyprotocol.TinyProtocol.registerPlayers(TinyProtocol.java:228) ~[?:?]
	at com.comphenix.tinyprotocol.TinyProtocol.<init>(TinyProtocol.java:87) ~[?:?]
	at net.jitse.npclib.listeners.PacketListener$2.<init>(PacketListener.java:61) ~[?:?]
	at net.jitse.npclib.listeners.PacketListener.start(PacketListener.java:61) ~[?:?]
	at net.jitse.npclib.NPCLib.registerInternal(NPCLib.java:67) ~[?:?]
	at net.jitse.npclib.NPCLib.<init>(NPCLib.java:57) ~[?:?]
	at com.mc_atlas.atlasmachinationsaddon.AtlasMachinationsAddon.onEnable(AtlasMachinationsAddon.java:44) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:254) ~[patched_1.13.2.jar:git-Paper-436]
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:325) ~[patched_1.13.2.jar:git-Paper-436]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) ~[patched_1.13.2.jar:git-Paper-436]
	at org.bukkit.craftbukkit.v1_13_R2.CraftServer.enablePlugin(CraftServer.java:438) ~[patched_1.13.2.jar:git-Paper-436]
	at org.bukkit.craftbukkit.v1_13_R2.CraftServer.enablePlugins(CraftServer.java:352) ~[patched_1.13.2.jar:git-Paper-436]
	at net.minecraft.server.v1_13_R2.MinecraftServer.l(MinecraftServer.java:613) ~[patched_1.13.2.jar:git-Paper-436]
	at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:575) ~[patched_1.13.2.jar:git-Paper-436]
	at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:435) ~[patched_1.13.2.jar:git-Paper-436]
	at net.minecraft.server.v1_13_R2.DedicatedServer.init(DedicatedServer.java:316) ~[patched_1.13.2.jar:git-Paper-436]
	at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:791) ~[patched_1.13.2.jar:git-Paper-436]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_152]

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
arnhavcommented, Apr 18, 2019

So, I should probably clarify. I was a bit of a noob and said “shade” when I didn’t actually shade the API into my own plugin. I added the plugin version of NPCLib as a dependency. I just shaded (actually this time) the API into my own plugin (I use Maven and I use IntelliJ) and now I’m getting another error:

java.lang.NullPointerException: null
	at com.mc_atlas.atlasmachinationsaddon.npclib.NPCLib.createNPC(NPCLib.java:80) ~[?:?]
	at com.mc_atlas.atlasmachinationsaddon.npclib.NPCLib.createNPC(NPCLib.java:96) ~[?:?]
	at com.mc_atlas.atlasmachinationsaddon.util.NPCSpawner.spawnTownSteward(NPCSpawner.java:16) ~[?:?]
	at com.mc_atlas.atlasmachinationsaddon.util.DatabaseManager.loadCitizens(DatabaseManager.java:97) ~[?:?]
	at com.mc_atlas.atlasmachinationsaddon.AtlasMachinationsAddon.onEnable(AtlasMachinationsAddon.java:108) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:265) ~[paperclip.jar:git-Paper-"c36f2062"]
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:334) ~[paperclip.jar:git-Paper-"c36f2062"]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:412) ~[paperclip.jar:git-Paper-"c36f2062"]
	at org.bukkit.craftbukkit.v1_13_R2.CraftServer.enablePlugin(CraftServer.java:443) ~[paperclip.jar:git-Paper-"c36f2062"]
	at org.bukkit.craftbukkit.v1_13_R2.CraftServer.enablePlugins(CraftServer.java:357) ~[paperclip.jar:git-Paper-"c36f2062"]
	at net.minecraft.server.v1_13_R2.MinecraftServer.l(MinecraftServer.java:608) ~[paperclip.jar:git-Paper-"c36f2062"]
	at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:570) ~[paperclip.jar:git-Paper-"c36f2062"]
	at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:431) ~[paperclip.jar:git-Paper-"c36f2062"]
	at net.minecraft.server.v1_13_R2.DedicatedServer.init(DedicatedServer.java:316) ~[paperclip.jar:git-Paper-"c36f2062"]
	at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:787) ~[paperclip.jar:git-Paper-"c36f2062"]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_152]

EDIT: So it looks like I was adding in an extra step… I just had to compile the plugin during the package phase of Maven. Marked as resolved.

0reactions
JitseBcommented, May 3, 2019

Fixed in release 1.4.2!

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.NoSuchMethodError but Method can be found within ...
It seems to me in Bukkit it cannot find code from my API, at all. If I call a method within the parent...
Read more >
Why Spark Submit causes NoSuchMethodError when I run a ...
1 Answer 1 ... As mentioned by @Gregoire, The issue is due to the jar file which is in the Spark environment, as...
Read more >
Resolving NoSuchMethodError (SCALA/JAVA) - Medium
This error is a runTime error which occurs as a result of missing method definition in the classes available in the ClassPath.
Read more >
Plugin throwing NoSuchMethodError on RecipeExecutor.save ...
I want to create a plugin for Android Studio which adds a new project template. This template would be an Android project with...
Read more >
NoSuchMethodError on jbossesb-4.8 - JBoss.org
I have a workaround for now: I used the Maven Shade plugin on infinispan-core/pom.xml to shade the org.jboss.logging package. Then I changed the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found