NoSuchMethodError

Discussion in 'Plugin Development' started by dvdbrander, Sep 2, 2012.

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

    dvdbrander

    I get Caused by: java.lang.NoSuchMethodError: nl.dvdbrander.defaults.cuboid.Cuboid.getBlocks()Ljava/util/ArrayList;, while that method does exist.
    Code:
    -----Somewhere in my code, total representing a Cuboid-----
        System.out.println(total); <<-- nl.dvdbrander.defaults.cuboid.Cuboid@678d9f96
        System.out.println(total.getBlocks()); <<---error
     
     
    -----Class Cuboid-----
      public ArrayList<Block> getBlocks() {
        ArrayList<Block> blocks = new ArrayList<Block>();
        for (int x = xMin; x <= xMax; x++) {
          for (int y = yMin; y <= yMax; y++) {
            for (int z = xMin; z <= zMax; z++) {
              blocks.add(new Location(Bukkit.getWorld(world), x, y, z).getBlock());
            }
          }
        }
        return blocks;
      }
     
    -----Error-----
    10:50:07 [SEVERE] Could not pass event PlayerInteractEvent to JailDigger
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:332)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:177)
            at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:355)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:649)
            at net.minecraft.server.Packet15Place.handle(SourceFile:58)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:276)
            at net.minecraft.server.NetServerHandler.d(NetServerHandler.java:109)
            at net.minecraft.server.ServerConnection.b(SourceFile:35)
            at net.minecraft.server.DedicatedServerConnection.b(SourceFile:30)
            at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:581)
            at net.minecraft.server.DedicatedServer.q(DedicatedServer.java:212)
            at net.minecraft.server.MinecraftServer.p(MinecraftServer.java:474)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:406)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
    Caused by: java.lang.NoSuchMethodError: nl.dvdbrander.defaults.cuboid.Cuboid.getBlocks()Ljava/util/ArrayList;
            at nl.dvdbrander.mcBadlands.JailDigger.Jail.<init>(Jail.java:22)
            at nl.dvdbrander.defaults.cuboid.DefineCuboid.finish(DefineCuboid.java:69)
            at nl.dvdbrander.defaults.cuboid.DefineCuboid.onSecondClick(DefineCuboid.java:65)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:330)
            ... 16 more
     
  2. you checked versions of the compiling lib and the lib you used on the server?
     
  3. Offline

    dvdbrander

    If by lib you mean version of craftbukkit then yes.
     
  4. Offline

    escortkeel

    Well, the exception was thrown in the body of the Class Jail's constructor. Please give us the contents of that.

    Most likely though, you need to completely recompile all of your classes.
     
  5. Offline

    md_5

    Recompile all your classes, 'clean an build' in your ide.
     
  6. Offline

    dvdbrander

    Deleted the plugin, cleaned the project, compiled, same problem.

    Escortkeel, the 1st 2 lines are in the Jail's constructor, the 2nd line of code is line 22.
     
  7. can you give us the .jar file, so we can see if the recompiling suceeded?
     
  8. Offline

    dvdbrander

    I'll pm it
     
Thread Status:
Not open for further replies.

Share This Page