[英]Debugging standalone Spring Boot application (Intellij IDEA)
I am using Intellij IDEA 14.1 and I am trying to debug the most basic standalone Spring Boot 1.2.5 application. 我正在使用Intellij IDEA 14.1,我正在尝试调试最基本的独立Spring Boot 1.2.5应用程序。 Would someone please tell me how to do that? 有人请告诉我该怎么做?
I've read http://docs.spring.io/autorepo/docs/spring-boot/1.2.5.RELEASE/maven-plugin/usage.html but have not been successful in making it work. 我已经阅读了http://docs.spring.io/autorepo/docs/spring-boot/1.2.5.RELEASE/maven-plugin/usage.html但是没有成功地使它工作。 The easiest would be to disable the forking that Spring Boot is using when debugging, but again, I was not successful in doing so. 最简单的方法是禁用Spring Boot在调试时使用的分叉,但同样,我没有成功。 (-Dfork=false?) (-Dfork =假?)
Any help is much appreciated! 任何帮助深表感谢!
I am confused. 我很困惑。
You have a main
method that starts your standalone Spring Boot application, right? 你有一个启动独立Spring Boot应用程序的main
方法,对吧? Well, right click on that and choose Debug 'YourApp'
好吧,右键单击它并选择Debug 'YourApp'
The issue above did not require anything specific related to Spring Boot . 上面的问题不需要任何与Spring Boot相关的特定内容 。 I have found that there was an issue in the error log of the IDE saying can't proxy final class class com.sun.tools.jdi.ClassTypeImpl
which was related to an outdated JRebel plugin I had installed in my IDE. 我发现IDE的错误日志中存在一个问题,即saying can't proxy final class class com.sun.tools.jdi.ClassTypeImpl
,它与我在IDE中安装的过时JRebel插件有关。 The issue was then resolved by updating the outdated JRebel plugin. 然后通过更新过时的JRebel插件解决了该问题。 Afterwards, it is the usual process as if you were debugging any other application 之后,这是通常的过程,就像您正在调试任何其他应用程序一样
When you create a new remote configuration in IntelliJ it gives you the command line arguments for remote debugging. 在IntelliJ中创建新的远程配置时,它为您提供了远程调试的命令行参数。
For example, start your Spring Boot application with: 例如,使用以下命令启动Spring Boot应用程序:
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8008 -jar yourapplication.jar
Then select the debug icon to enable your breakpoints. 然后选择调试图标以启用断点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.