简体   繁体   English

调试独立的Spring Boot应用程序(Intellij IDEA)

[英]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中创建新的远程配置时,它为您提供了远程调试的命令行参数。

  • open edit configurations 打开编辑配置
  • add new remote configuration 添加新的远程配置
  • Now the configuration tab on the right lists the Java command line arguments for running the jar in debug mode. 现在,右侧的配置选项卡列出了用于在调试模式下运行jar的Java命令行参数。

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.

相关问题 使用IntelliJ IDEA调试Spring WebFlux / Reactor应用程序 - Debugging a Spring WebFlux / Reactor application with IntelliJ IDEA Spring Boot无法使用IntelliJ IDEA启动应用程序 - Spring boot failing to start application using intellij idea 部署在STS中的Spring Boot应用程序可以正常工作,但不能在IntelliJ Idea中运行 - Spring boot application deployed in STS works fine, but not in IntelliJ Idea Spring Boot微服务Intellij Idea - Spring Boot Microservice Intellij Idea Intellij是否通过Spring Boot支持独立Gorm - Does Intellij Support Standalone Gorm with Spring Boot Spring 带有 JSP 的引导应用程序不能作为独立 jar 工作,但可以在 IntelliJ 内工作 - Spring Boot application with JSP do not work as a standalone jar but works from within IntelliJ 对 Spring Boot 项目的 IntelliJ IDEA 持久化支持 - IntelliJ IDEA persistence support for Spring Boot project Spring Boot + Intellij Idea +休眠-奇怪的堆栈跟踪 - Spring Boot + Intellij Idea + Hibernate - strange stacktrace 带有 Angular 和 Spring Boot 的 IntelliJ IDEA 项目 - IntelliJ IDEA Project with Angular and Spring Boot 将我的 spring 引导应用程序从多模块移动到零模块并且在 IntelliJ IDEA 上未检测到 application.properties - Moved my spring boot application from mullti module to zero module and application.properties is not detected on IntelliJ IDEA
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM