Solved java.lang.NoSuchMethodError

Discussion in 'Plugin Development' started by discounter24, Feb 9, 2014.

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

    discounter24

    Hey Community,
    I´ve got a problem. I don´t know why I get this NoSuchMethodError:
    Code:
    Error occurred while enabling KitPvP v1.0 (Is it up to date?)
    java.lang.NoSuchMethodError: de.discounter.sign.SignListener.<init>(Lorg/bukkit/plugin/Plugin;Lde/discounter/sign/SignConfig;)V
        at de.discounter.kitpvp.Main.onEnable(Main.java:61) ~[?:?]
    Main.java:61:
    Code:java
    1. SignConfig sCfg = new SignConfig(this);
    2. sCfg.createConfig("ConfigSign");
    3.  
    4. m.registerEvents(new SignListener(this,sCfg), this);


    SignConfig.java:
    Code:java
    1. public class SignListener implements Listener {
    2.  
    3. Plugin plugin;
    4. public SignConfig cfg;
    5.  
    6. public SignListener(Plugin pl, SignConfig cfg){
    7. plugin = pl;
    8. this.cfg = cfg;
    9. }
     
  2. Offline

    Wolvereness Bukkit Team Member

    One of two reasons this is happening.
    1. You have another one of your plugins using the package de.discounter.sign. You should always include the name of your plugin as the third-level, like de.discounter.kitpvp.sign (and, the other plugin should do the same with whatever its own name is).
    2. You didn't export the SignListener after you changed the constructor, and you are instead using an old version.
    /edit: It's also okay to use the plugin-name as a fourth level (or any level after your personal domain), like de.discounter.bukkit.kitpvp.sign. You can choose how you do your sub-packages, so long as you have your personal domain indicate the top-levels.
     
  3. Offline

    discounter24

    Thank you! Now it works!

    btw: It was reason one.
     
Thread Status:
Not open for further replies.

Share This Page