-
Notifications
You must be signed in to change notification settings - Fork 217
debugging spring boot with eclipse
Borys H.N edited this page Dec 6, 2016
·
7 revisions
debugging your spring-boot application with eclipse
we are going to do this in a few phases.
- re-configure our
Spring Boot Apprun configuration to allow remote debugging - create a new
Remote Java Applicationdebug configuration to connect - we will then proceed as normal! i.e. mark break points, navigate to
localhost:3000, etc.
- check out developing with eclipse and make sure eclipse is configured correctly
- open spring perspective, and see boot dashboard
- or open boot dashboard view
-
edit your
Spring Boot Apprun configuration- enable debug output in the first tab
- copy these arguments to
VM arguemntsin the Arguments tab-
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000- notice the server will now listen on port 8000 (debug), as well as 3000 (browser)
-
- apply and save
- now run the
Spring Boot Appin normal mode (not debug mode)
-
create a new debug configuration of type
Remote Java Application- add name
- configure
- browse for your project root
- connection type
Standard (Socket Attach) - host: localhost
- port: 8000
- save
-
add break point
- add a break point to the return statement of the testGetJson() method in the TestController class
src/main/java/io/abnd/rest/TestController.java
-
launch our new
Remote Java Applicationdebug configuration in debug mode- the server will connect, begin the remote debugging session, and start the application
- you may receive an initial
SilentExitException, just pressF8and resume
- you may receive an initial
- navigate to
localhost:3000then press theHello Pagebutton - enter debugging mode and see the return object at the break point
- press
F8to resume
- press
- the server will connect, begin the remote debugging session, and start the application