Topic
4 replies Latest Post - ‏2014-02-04T14:51:13Z by e_yuen
NikolayGarbuzov
NikolayGarbuzov
3 Posts
ACCEPTED ANSWER

Pinned topic Liberty Profile Idea remote debug not work

‏2014-02-03T09:44:10Z |

Hello,

We have tried to do remote debug of Liberty Profile 8.5.5 and faced with the issue.

We have started LP using Eclipse WDT in debug mode and than configured Idea remote debug to the specified port. But it didn't work.

Please, see attached screenshots.

Is there any workarounds how to do remote debug or will it be fixed in the next releases?

Thanks,

Nikolay

  • e_yuen
    e_yuen
    27 Posts
    ACCEPTED ANSWER

    Re: Liberty Profile Idea remote debug not work

    ‏2014-02-03T16:23:32Z  in response to NikolayGarbuzov

    When you start the server in debug mode from WDT, WDT will automatically configured and attach the debugger to the Liberty server process.  There is no need to create another remote debug launch configuration for it.  You can debug the java class directly without extra launch configuration setup.  Is there any particular reason for using another debug client?

    You can only have one debug client attached to a particular debug process at a time.  If you happens to require to connect to the debug process using a different launch configuration for other reasons, you'll need to disconnect the already attached debug process from the debug view before you can connect to it. 

  • jgawor
    jgawor
    9 Posts
    ACCEPTED ANSWER

    Re: Liberty Profile Idea remote debug not work

    ‏2014-02-04T03:44:15Z  in response to NikolayGarbuzov

    I agree with e_yuen. Starting Liberty from Eclipse in debug mode and then trying to connect to it from another debugger (IDEA in your case) won't work. Outside of Eclipse, you can start Liberty in debug mode directly from command line using "server debug" or you can pass the debug parameters "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=51855" via jvm.options file or using JVM_ARGS environment property.

     

     

  • NikolayGarbuzov
    NikolayGarbuzov
    3 Posts
    ACCEPTED ANSWER

    Re: Liberty Profile Idea remote debug not work

    ‏2014-02-04T07:06:59Z  in response to NikolayGarbuzov

    Thanks for answers guys.

    >> Is there any particular reason for using another debug client?

    Yes, I'm using IDEA for development.

    >> Outside of Eclipse, you can start Liberty in debug mode directly from command line using "server debug" ...

    Yes, it will definitely work. But I'm interesting in using WDT for this purpose. It's not very comfortable to use WDT for configuration, running server in "run" mode but using terminal to run server in "debug" mode. WDT is positioned as tool for LP full-management, so my desire is to use it without switching to terminal.

  • e_yuen
    e_yuen
    27 Posts
    ACCEPTED ANSWER

    Re: Liberty Profile Idea remote debug not work

    ‏2014-02-04T14:51:13Z  in response to NikolayGarbuzov

    You have 2 ways to implement that depending on how often you need to start the server in debug mode:

    1. You can start the server in WDT in debug mode as usual. Then, switch to the debug view.  Select the server process and click on the disconnect button on the view or on the pop up menu.  After that, you can connect to the debug process using the launch configuration that you have created. If you are restarting the server in debug mode again, then you have to go through the same step again.

    2. This is similar to what jgawor described but doing it inside WDT.  You can right click on the server on the Servers view and select New->Server Environment File->jvm.options.  Then, add the line "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=51855" to the file.  From now on, when you start the server in "run" mode, not debug mode, in WDT, the server is started with debug enabled and you can use the launch configuration that you have created the connect to the debug process.  One thing to note is that if you want to start the server in non-debug mode, you have to comment out the -agentlib line from the jvm.options file.  You can find it under the same directory as the server.xml file in the workspace.

    Elson