NoSuchMethodException Error

Discussion in 'Spigot Plugin Development' started by dvargas135, Jun 22, 2016.

  1. I'm getting this error when I try to hook my plugin with ProtocolLib. Could anyone help?
    Code (Text):
    java.lang.NoSuchMethodException: e.a.b.Aa.<init>(ez.plugins.dan.IeZMain)
        at java.lang.Class.getConstructor0( ~[?:1.8.0_25]
        at java.lang.Class.getConstructor( ~[?:1.8.0_25]
        at ez.plugins.dan.IeZMain.protocolLibHook( [eZProtector-YAT-001.jar:?]
        at ez.plugins.dan.IeZMain.onEnable( [eZProtector-YAT-001.jar:?]
        at [spigot.jar:git-Spigot-db6de12-d3e0b6f]
        at [spigot.jar:git-Spigot-db6de12-d3e0b6f]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin( [spigot.jar:git-Spigot-db6de12-d3e0b6f]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin( [spigot.jar:git-Spigot-db6de12-d3e0b6f]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins( [spigot.jar:git-Spigot-db6de12-d3e0b6f]
        at net.minecraft.server.v1_8_R3.MinecraftServer.s( [spigot.jar:git-Spigot-db6de12-d3e0b6f]
        at net.minecraft.server.v1_8_R3.MinecraftServer.k( [spigot.jar:git-Spigot-db6de12-d3e0b6f]
        at net.minecraft.server.v1_8_R3.MinecraftServer.a( [spigot.jar:git-Spigot-db6de12-d3e0b6f]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init( [spigot.jar:git-Spigot-db6de12-d3e0b6f]
        at [spigot.jar:git-Spigot-db6de12-d3e0b6f]
        at [?:1.8.0_25]

    This is the method on the main class:
    private void protocolLibHook() {
        if (!config.getBoolean(tab-completion.disabled)) {
        } else {
            if (Bukkit.getPluginManager().isPluginEnabled("ProtocolLib")) {
                try {
                    Class<?> packetClass = Aa.class;
                    Constructor<?> co = packetClass.getConstructor(IeZMain.class);
                } catch (Throwable throwable) {
  2. What is on line 195?
  3. Constructor<?> co = packetClass.getConstructor(IeZMain.class);
  4. MiniDigger


    how does the contructor of the class e.a.b.Aa look like? what arguments does it need? you are searching for the constructor that takes a IeZMain object but there doesn't seem to be one.
    Also, why on earth are you testing your plugin with obfuscation?
  5. That is actually a very good question lol.
  6. im not testing it with obfuscation lol i just renamed that class like that for later adding it as an exception so the obfuscator doesn't screw it up
  7. Isn't it the obfuscator's job to do that?
  8. MiniDigger


    not if you are unable to configure it right ^^
  9. nvm i got it working lol thanks guys and sorry for the inconvenience
  10. That's ok, that is why we are here to help! If you figured out yourself, even better!