Remote Debug Spring Boot ApplicationinCloud PDF
Remote Debug Spring Boot ApplicationinCloud PDF
Add 'devtool' feature to the project by Right-Clicking the project -> Sprint Tools -> Add Boot Devtools. This dependency can be
added manually also.
Save the project.
Click
Note: To know more about boot dashboard feature please refer links in "Reference" section
Debug configuration:
Add debug configuration in manifest.yml
Replace the manifest.yml with the following code. Use different name for the application
manifest.yml
--applications:
- name: gs-rest-service
path: target/gs-rest-service-0.1.0.jar
env:
JAVA_OPTS: "-Xdebug -Xrunjdwp:server=y,transport=dt_socket,suspend=n"
Ensure "RemoteSpringApplication" is started by looking in the console. If the application did not start, please see "Troubleshooting"
section.
Debug configuration:
Click "Run -> Debug Configurations..."
Double click "Remote Java Application "
Enter name for the configuration -> select project, use default host and port (host: localhost, port:8000).
Click Apply
Click Debug
Troubleshooting:
Remote debug works in public/external network, not GE internal network. So please connect to public network and debug.
Cloud foundry account should be accessible from public network.
RemoteSpringApplication - did not start
One of the reason could be proxy is enabled in STS. Clear the proxy setting
Ensure the network is public/external.
Alternative Debugger:
Please follow the link for alternative debugger: Remote Debugging your Java microservice (or application)
References:
https://spring.io/blog/2015/10/08/the-spring-boot-dashboard-in-sts-part-1-local-boot-apps
https://spring.io/blog/2015/10/15/the-spring-boot-dashboard-in-sts-part-2-working-with-cloud-foundry
https://spring.io/blog/2015/10/22/the-spring-boot-dashboard-in-sts-part-3-spring-boot-devtools-reloaded
https://www.youtube.com/watch?v=fofhDqnb92g
https://www.youtube.com/watch?v=A70NMxV13TI