-
Notifications
You must be signed in to change notification settings - Fork 220
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 App
run configuration to allow remote debugging - create a new
Remote Java Application
debug 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 App
run configuration- enable debug output in the first tab
- copy these arguments to
VM arguemnts
in 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 App
in 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 Application
debug configuration in debug mode- the server will connect, begin the remote debugging session, and start the application
- you may receive an initial
SilentExitException
, just pressF8
and resume
- you may receive an initial
- navigate to
localhost:3000
then press theHello Page
button - enter debugging mode and see the return object at the break point
- press
F8
to resume
- press
- the server will connect, begin the remote debugging session, and start the application