NoSuchMethodError when the method obviously exists

点点圈 提交于 2019-12-11 17:57:17

问题


20:15:43 [INFO] macintosh264 issued server command: /sell hand
20:15:43 [INFO] [XYZShop] MacCommand sell executed
20:15:43 [SEVERE] null
org.bukkit.command.CommandException: Unhandled exception executing command 'sell' in plugin XYZShop v0.1.3
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:186)
        at org.bukkit.craftbukkit.v1_4_6.CraftServer.dispatchCommand(CraftServer.java:510)
        at net.minecraft.server.v1_4_6.PlayerConnection.handleCommand(PlayerConnection.java:979)
        at net.minecraft.server.v1_4_6.PlayerConnection.chat(PlayerConnection.java:897)
        at net.minecraft.server.v1_4_6.PlayerConnection.a(PlayerConnection.java:852)
        at net.minecraft.server.v1_4_6.Packet3Chat.handle(Packet3Chat.java:44)
        at net.minecraft.server.v1_4_6.NetworkManager.b(NetworkManager.java:290)
        at net.minecraft.server.v1_4_6.PlayerConnection.d(PlayerConnection.java:112)
        at net.minecraft.server.v1_4_6.ServerConnection.b(SourceFile:39)
        at net.minecraft.server.v1_4_6.DedicatedServerConnection.b(SourceFile:30)
        at net.minecraft.server.v1_4_6.MinecraftServer.r(MinecraftServer.java:598)
        at net.minecraft.server.v1_4_6.DedicatedServer.r(DedicatedServer.java:224)
        at net.minecraft.server.v1_4_6.MinecraftServer.q(MinecraftServer.java:494)
        at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:427)
        at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849)
Caused by: java.lang.NoSuchMethodError: dev.xyzcraft.net.database.DatabaseHandler.getItem(IS)Ldev/xyzcraft/net/xyzshop/dataObject/MSItem;
        at dev.xyzcraft.net.xyzshop.commands.SellCommand.onCommand(SellCommand.java:63)
        at dev.xyzcraft.net.xyzshop.util.MacCommand.onCommand(MacCommand.java:44)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
        ... 15 more

I get that exception

here's the code: https://github.com/macintosh264/XYZShop

Lastly, I'm using a Mod API for a popular video game, Minecraft, entitled Bukkit. Here's the JavaDoc, and library

http://dl.bukkit.org/downloads/bukkit/

http://jd.bukkit.org

"I also have this problem with another project that uses MySQL, and the stack trace occurs WHENEVER the mysql class is used. "

  • Macintosh264

回答1:


It seems like whatever your trying to execute (i.e.the method that holds the command) isn't reading it properly. Try re-packaging your project, it's happened to me many times and that is usually an easy fix.



来源:https://stackoverflow.com/questions/14096479/nosuchmethoderror-when-the-method-obviously-exists

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!