[Tutorial] Remote debugging with bukkit

Discussion in 'Resources' started by MikeMatrix, Aug 9, 2012.

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


    Not sure if it was actually mentioned somewhere, but I had a lot of problems starting/stopping more than once until I checked a certain checkbox in Eclipse "Enable remote termination of VM". If I didn't do that, the port 1000 would say it was busy, and then even if I changed that, the Minecraft server port (25565) would say it was busy instead. Checking that checkbox seemed to solve both problems. Otherwise, only rebooting (not even logging out/in) would solve the busy port problem. I also have to remember to never close the server by closing the server terminal window - if I launch in debug, terminating from Eclipse is the only way to free up the ports again.

    The other weird problem I'm having now is the debug version of the server script will only run if I execute it as superuser. The regular server script could load using only doubleclicking a shortcut, which was a lot more convenient.

    Any way I can get this debug script to run without having to use the terminal?

    Hey, I had another idea. Does anyone think it's maybe possible to change around a few things so you can actually hot-plug code while the game is running? Maybe the plug-in specific stuff could be moved to a separate thread or something? Making a template for that is something I'm willing to do if I can get some help from the community.

    I'm working on a set of four tutorials on Modding that this would be perfect for. Like, if you had the remote debugger all set up, and set a breakpoint at the start of where you have a method to create a structure. Then, as you step through the loop, the blocks get added in the game as you pass the line of code that does it. That would be so awesome.

    Right now I'm getting the connection timeout thing MikeMatrix warned about, which means once I'm stopped in the debugger, I can kiss that instance of the game/server goodbye. I have to always terminate from Eclipse after, and then relaunch everything again.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 27, 2016
  2. I am still having this issue. He never seemed to have gotten a reply.

    Here is a screenshot of my Debug Config: http://prntscr.com/ywt0h
    Here is a screenshot of my console listening: http://prntscr.com/ywtbw
    Here is a screenshot of the debug button I am clicking on: http://prntscr.com/ywtfe
    Here is a screenshot of the issue I am still getting: http://prntscr.com/ywtjj

    Please help!
  3. Offline


    In the debug config you have set the port to connect to to 8000
    and in the console it shows you have set the listen port to port 1000.

    Now what happens is that your eclipse debugger tries to connect to port 8000 which wont work since your debug server is listening on port 1000. You must set both ports to the same number for it to work.
  4. Offline


    Thanks man!
    So much time spent to export ... :p!
  5. Offline


    I had the same "refuse connect" issue but solved it.

    I first used this nice tutorial:


    My run.sh:

    cd bukkit/server/
    gnome-terminal -x java -Xdebug -Xrunjdwp:transport=dt_socket,address=12374,server=y,suspend=y -jar  craftbukkit.jar 
    Then i configured everything in eclipse like described in this great tutorial, but instead of localhost in the debug config i used my internal ip "192.168.etc.bla"

    If everything is finished, you have to click first on the little play button with the toolbox underneath and second on the bug on the left side


    Maybe this will help some of you.

    If something is wrong spelled please correct me, I'm sadly no native english speaker :D
  6. Offline


    I'm going to try and get this to work... sounds like so much fun!
  7. Offline


  8. Offline


    I get the same error.
  9. Offline


    Help i dont know on how to add parameteters to eclipse i am so confuzed :(
  10. Offline


    It worked fine for the first time, but now whenever I debug with the same settings, edit one thing and save, I get a load of "out of synch" warnings :(

    Thanks for the tutorial though, saved me a load of time for ~an hour :)
  11. Offline


    It's because the JVM hotswap only supports adding to a method body. Check out my tutorial on JRebel to fix that :)
  12. Offline


    Geeze would be nice for some help :(
  13. Offline


    One thing to keep in mind regarding 'connection refused' msgs.
    Many systems are set up so that only administrative programs can listen on port numbers from 1024 and below. These are reserved and should not be used for 'user' related tasks like debugging invironments
  14. Offline


    I know this is an old thread but i need a fix for the connection refused message. i tried all the fixes in this thread but it still won't work :( I'm running the server on port 25565 and using the port 25567 for the debug thingy, just because i know 25567 is usable and available, like 25565 is for minecraft.
  15. Offline


    OMG this works and it is so useful!
    You saved me lots of time thanks!
  16. Offline


    This is a really nice tutorial, thanks, will use it :D.
  17. Offline


    I should've done this ages ago, this is so much win!
  18. Offline

    turt2live Retired Staff

    Europia79 likes this.
Thread Status:
Not open for further replies.

Share This Page