+ Reply to Thread
Results 1 to 3 of 3

Thread: how to debug server side code

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face how to debug server side code

    I am learning server side code base on ES4, my IDE is Myeclipse 6.6. but i do not konw how to set the debug environment. anybody can help me .thx.

  2. #2
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,216
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    I'm not familiar with MyEclipse. It is possible to use a debugger on a running ES5 server, and I can get those instructions for another IDE if you like - perhaps it will be close enough. In the meantime, have you read Debugging Extensions?

    I just noticed that you are learning ES4, not ES5. The Debugging Extensions article is still mostly correct.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  3. #3
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,216
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    I found my notes on setting up the server side IDE for debugging. These notes are for IntelliJ, and Eclipse should be similar. I assume that MyEclipse will also be similar.
    ----------------
    The key is setting up a Debug Launch Configuration of the type "Remote Application", and choosing the port as specified in your ElectroServer startup.

    Of note:
    • The port is 8000 for my example.
    • In both IDEs you would want to pick your server project as the location for the IDE to find source for the program under debug.
    • The startup parameters for the vm (-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,ad dress=8000) need to go into the Additional JVM Parameters section of the ES Admin, or if you're using a custom start script, just in the main Java execute line.
    • If you have something you want to debug on server startup (like a data populator or something), and are worried about connecting your debugger in time, you can change the "suspend=n" in the above line to "suspend=y" - this will prevent the VM from actually starting until your debugger has connected.
    ----------------------

    Since you are using ES4, not ES5, you don't have a place in the web admin to add startup commands. You will have to start ES4 using a java -jar command line script (or batch file if you are on Windows).
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts