Remote debugging of Galssfish in eclipse, tracking the source code of GlassFish. 1) To establish the project
To track the source code, first create a new project in Eclipse and import the GlassFish into the project. Make sure that the code you want to follow can be compiled.
GlassFish source code can be downloaded on its website: https://glassfish.dev.java.net/
2) Set GlassFish
Set the GlassFish parameter, make sure the Asadmin command is joined to the system path.
Enter the following command in CMD
>asadmin Set Server-config.java-config.debug-enabled=true >asadmin set server-config.java-config.debug-options= "-xdebug xrunjdwp:transport=dt_socket,server=y,suspend=n, address=9009 " |
The results of the operation are shown in the following figure
3) Set Eclipse
Select 1) in the construction of the project, select Run->debug configurations
Then choose Remote Java Application-> New
Next, set the parameters, as shown in the following figure
4) Start Debug
After you set breakpoints in your code, select Debug. To run the function you need to debug, you can enter the program. As shown in the following figure.
The next step is the time you have to debug your program.