In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is to share with you about the SpringBootDebug debugging process, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Let's take a look at it.
Recently found that Spring Boot can not debug Debug locally, the original Spring Boot upgrade, the corresponding plug-in command parameters have changed, so this article makes an upgrade.
Background:
When the Spring Boot project executes the startup command spring-boot:run using the Spring Boot Maven plug-in, if the breakpoint cannot be entered, the following settings should be made.
Official solution:
By default, the run goal runs your application in a forked process. If you need to debug it, you should add the necessary JVM arguments to enable remote debugging. The following configuration suspend the process until a debugger has joined on port 5005:
Let's just see what to do!
1. Add JVM parameters
Add jvmArguments configuration to the plug-in spring-boot-maven-plugin.
......... Org.springframework.boot spring-boot-maven-plugin 2.2.0.RELEASE-Xdebug-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005...
Or specify on the command line:
Mvn spring-boot:run-Dspring-boot.run.jvmArguments= "- Xdebug-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
For the latest configuration, please refer to the official instructions:
Https://docs.spring.io/spring-boot/docs/current/maven-plugin/examples/run-debug.html
2. Add a Remote
Add a Remote configuration to the development tool:
You only need to determine the Host and Port parameters.
Host: address
Localhost: local boot address
Port: Port
5005: the port specified on the command line above
3. Start debugging
Start the Spring Boot project with the jvmArguments parameter first:
The program stops at the listening port: 5005, and then debug starts Remote:
Go back to the project, start the output log, and then you can do breakpoint debugging.
This is remote debugging, can also help you debug remote Spring Boot application, but in local debugging to operate twice, slightly troublesome.
The above is what the SpringBootDebug debugging process is like, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.