Solved Plugin Error

Discussion in 'Plugin Development' started by HONHART, Jan 23, 2015.

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

    HONHART

    Hello,
    Info: I'm currently running two separate Minecraft servers, one private and one public. Both Servers are using separate but exact copies of the CraftBukkit.jar file, and both Servers are running the exact same Plugins and exact same versions of each Plugin.

    Both servers each have an exact copy of "TestPlugin.jar" in their plugin directories, both servers start up correctly, both server consoles display that "TestPlugin.jar" was enabled, both plugins inside Minecraft show up green in color (using command /plugins) stating that they are functional/no errors.

    Server Comparison
    1. While connected to Server #1 (No Issues)
      • Plugin command typed in and executed (i.e., /plugincommand) the plugin executes the command as it should and works perfectly (Minecraft and the Server Console shows the info as stated in the Plugin correctly)
    1. While connected to Server #2 (Issues)
    • Plugin command typed in and executed (i.e., /plugincommand) the plugin does not execute correctly and inside Minecraft I receive a "An internal error occured while attempting to perform this command" The Server Console shows
    • CONSOLE: ERROR]: null
    • CONSOLE: exception executing command 'plugincommand' in plugin "TestPlugin V1.0.0
    Question:
    Any suggestions as to why I may be getting this error on Server #2 and not Server #1? With the exception of the Server Software, All plugins being ran on both servers are exactly the same? The only different is MyMcAdmin, has anyone ran across an issue like this before? Is it possible that some plugins are not compatible with the MyMcAdmin? Without dumping MyMcAdmin as a Server, does anyone have any suggestions as to how I can go about resolving this?

    Server Information
    1. Server #1 - Private (For Plugin Development And Testing)
      • Hosted/Running bukkitgui.exe
      • CraftBukkit Version 1.7.2 R03
      • Plugins Installed
        • Essentials.jar
        • GroupManager.jar
        • TestPlugin.jar
    2. Server #2 - Public
      • Hosted/Running MyMcAdmin
      • CraftBukkit Version 1.7.2 R03
      • Plugins Installed
        • Essentials.jar
        • GroupManager.jar
        • TestPlugin.jar
     
  2. Offline

    mine-care

    @HONHART please provide the stack trace of your errors and your code, this will make it easy to trace the bug and therefore its cause. not sure how important if its on mcmyadmin or bukkitgui.
     
  3. Offline

    HONHART

     
    Last edited: Jan 23, 2015
  4. Offline

    SuperOriginal

    Stop watching whatever tutorial you're watching and post the stacktrace

    I could post a million things wrong but I have to go.
     
    HONHART likes this.
  5. Offline

    CraftCreeper6

    @HONHART
    What even... Nevermind.
    There are so many things wrong with this.
    • You use Logger
    • Location sight =new Location(w,x,y,z);{ - Can't even comprehend...
    • sender.hasPermission("wskeleton.spawn")||!(sender instanceof Player). - Always check before doing something with it. You'll be flooded with Stacktraces.
    Just to mention a few...
     
  6. Offline

    HONHART

    Code:
    org.bukkit.command.CommandException: Unhandled exception executing command 'skeleton' in plugin WSkeleton v1.0.0
    Console    :     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:175) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchCommand(CraftServer.java:683) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.PlayerConnection.handleCommand(PlayerConnection.java:952) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.PlayerConnection.a(PlayerConnection.java:814) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.PacketPlayInChat.a(PacketPlayInChat.java:28) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.PacketPlayInChat.handle(PacketPlayInChat.java:47) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.NetworkManager.a(NetworkManager.java:146) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.ServerConnection.c(SourceFile:134) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:655) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:545) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:457) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    : Caused by: java.lang.NullPointerException
    Console    :     at com.www.competitivecomputer.wskeleton.WSkeleton.onCommand(WSkeleton.java:51) ~[?:?]
    Console    :     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
     
  7. Offline

    Infuzion

    The error is on line 51 of WSkeleton.java
    What is that line?
     
  8. Offline

    HONHART

    Thanks for the feedback, I understand you guys are all experienced, and can point out way too many errors, unfortunately I am not. I'm just starting out with Java and want to learn.

    How would you change this code, I need to see the correct way to do this so that I can learn from it.

    I understand you guys can point out tons of stuff wrong, I expected this, but why does this work perfectly on my 1st Server and not on my 2nd Server? To me and I'm no genius, if the code sucks than it shouldn't work at all, but if the code is somewhat correct than I would think it should work on both.

    @Infuzion
    That's the main class file
     
    Last edited by a moderator: Feb 1, 2015
  9. Offline

    Infuzion

    @HONHART
    Are the two servers running different versions of java?
     
  10. Offline

    BaconStripzMan

    Stop watch TheBCBlowz Please.. Try PogoStick29Dev
     
    HONHART and mine-care like this.
  11. Offline

    HONHART

    Last edited by a moderator: Feb 1, 2015
  12. Offline

    Infuzion

    @HONHART
    Have you made any changes or removed blank lines when pasting it to bukkit forums? The error appears to be on line 51. Can you copy this line from your IDE?
     
  13. Offline

    HONHART

    @Infuzion
    Server #1
    Installed on Windows: Java Version 8 Update 25 (build 1.8.0_25-b18)

    Server #2
    Installed on Windows: Java Version 7 Update 51 (build 1.7.0_51-b13)
     
  14. Offline

    Skionz

    I am pretty sure that you have, but again, post your entire class. I am talking about the class corresponding to the stack-trace. Not an outdated version.
     
  15. Offline

    BaconStripzMan

    @Skionz @HONHART This says it all
    Code:java
    1. publicstaticfinal Logger log = Logger.getLogger("Minecraft");
     
  16. Offline

    HONHART

    @Infuzion
    I'll re-paste it directly from the IDE
     
  17. Offline

    Infuzion

    @HONHART
    Also what java version are you compiling with?
     
  18. Offline

    HONHART

    void
     
    Last edited: Jan 23, 2015
  19. Offline

    Skionz

    @HONHART Now post the corresponding stack-trace. The current one says there is an NPE on line 51, yet you have no line 51.
     
  20. Offline

    HONHART

    The Libraries From The Project In My IDE:
    1. Bukkit_1.7.2_R3
    2. CraftBukkit_1.7.2_R3
    3. JDK 1.7

    Give me a few minutes to startup my server again, run that command and paste the stacktrace

    StackTrace
    Code:
    Console    : [16:07:18 INFO]: Honhart issued server command: /wskeleton
    Console    : [16:07:21 INFO]: Honhart issued server command: /skeleton
    Console    : [16:07:21 ERROR]: null
    Console    : org.bukkit.command.CommandException: Unhandled exception executing command 'skeleton' in plugin WSkeleton v1.0.0
    Console    :     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:175) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchCommand(CraftServer.java:683) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.PlayerConnection.handleCommand(PlayerConnection.java:952) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.PlayerConnection.a(PlayerConnection.java:814) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.PacketPlayInChat.a(PacketPlayInChat.java:28) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.PacketPlayInChat.handle(PacketPlayInChat.java:47) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.NetworkManager.a(NetworkManager.java:146) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.ServerConnection.c(SourceFile:134) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:655) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:545) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:457) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    : Caused by: java.lang.NullPointerException
    Console    :     at com.www.competitivecomputer.wskeleton.WSkeleton.onCommand(WSkeleton.java:33) ~[?:?]
    Console    :     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Console    :     ... 13 more
    Console    : [16:07:25 INFO]: Honhart lost connection: Disconnected
    Console    : [16:07:25 INFO]: GroupManager - FINE - User record found for UUID: dd1a4077-3d94-4425-adcc-471b15a5a883:Honhart
    Console    : [16:07:25 INFO]: Honhart left the game.
    void

    Server Console:
    4:07:21 PM CONSOLE: [INFO] Honhart issued server command: /skeleton
    4:07:21 PM CONSOLE: ERROR]: null
    4:07:21 PM CONSOLE: exception executing command 'skeleton' in plugin WSkeleton v1.0.0

    This code above is all from Server #2

    The commands executes correctly and a Skeleton spawns on Server #1

    Server #1 Console:
    4:12:01 PM [INFO] Honhart issued server command: /skeleton
    4:12:01 PM [INFO] Skeleton Spawned!
     
    Last edited by a moderator: Feb 1, 2015
  21. Offline

    Skionz

    @HONHART Does "world" exist on both?
     
  22. Offline

    HONHART

    No, only only on Server #1

    Not sure if this helps; On Server #2 Hosted using MyMcAdmin

    I cloned my entire Server #2 Minecraft directory and started it up using bukkitgui.exe instead of MyMcAdmin.

    Ran the command /skeleton and I get the same error as I did using MyMcAdmin. So I wonder if it has something to do with the Version of Java that's installed on Windows????
     
    Last edited by a moderator: Feb 1, 2015
  23. Offline

    Skionz

    That would be why...
     
    HONHART likes this.
  24. Offline

    HONHART

    It's looking for a world name "World"?

    aaaahh, World w = Bukkit.getServer().getWorld("world");

    Is there a way to change this code to automatically pull the name of the world versus giving it a predefined world name?

    Would this work?
    Code:
    World w = Bukkit.getServer().getWorld("");
     
    Last edited by a moderator: Feb 1, 2015
  25. Offline

    WesJD

    @HONHART no, because there is no world folder named "".
     
    HONHART likes this.
  26. Offline

    Infuzion

    @HONHART
    p.getLocation().getWorld() or similar
     
  27. Offline

    HONHART

    So I could change my existing code:

    Code:
    World w = Bukkit.getServer().getWorld("");
    To:
    Code:
    w = getLocation().getWorld();
    Sorry guys, I know this is way below basic for you guys....

    or what I meant to write was

    Code:
    w.getLocation().getWorld();
     
    Last edited by a moderator: Feb 1, 2015
  28. Offline

    Skionz

    @HONHART Use a file and store the name in it.
     
    HONHART likes this.
  29. Offline

    HONHART

    I was thinking that, so that it could be changed per server, but unfortunately I don't know how to do that yet.
     
  30. Offline

    Skionz

    There are Javadocs for a reason ;)
     
    HONHART likes this.
Thread Status:
Not open for further replies.

Share This Page