Solved NoSuchMethod error

Discussion in 'Plugin Development' started by Gorbit99, Dec 10, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Gorbit99

    I basically changed the name of my class with refactor, and an error popped up
    Error (open)

    [11:48:03] [Server thread/ERROR]: Error occurred while enabling Alchemy-Altars v1.0 (Is it up to date?)
    java.lang.NoSuchMethodError: io.github.gorbit99.EventListener.<init>(Lio/github/gorbit99/AltarsMainClass;)V
    at io.github.gorbit99.AltarsMainClass.onEnable(AltarsMainClass.java:24) ~[?:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:741) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.Bukkit.reload(Bukkit.java:535) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchServerCommand(CraftServer.java:627) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:412) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:375) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_65]

    The two code snippets the error is talking about are these:
    Code:
    static AltarsMainClass plugin;
    Main Class (AltarsMainClass to be specific):
    @Override
    public void onEnable() {
       plugin = this;
       EventListener listener = new EventListener(plugin);
       getServer().getPluginManager().registerEvents(listener, this);
    }
    
    EventListener:
    public EventListener(AltarsMainClass plugin) {
       this.plugin = plugin;
    }
    The name "EventListener" was already used for one of my classes, solved it

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     

    Attached Files:

    Last edited by a moderator: Dec 10, 2015
Thread Status:
Not open for further replies.

Share This Page