【问题标题】:Broken Spring Boot Debugging process - ignoring breakpoints损坏的 Spring Boot 调试过程 - 忽略断点
【发布时间】:2015-01-28 07:36:39
【问题描述】:

我遇到过两次同样的问题。一旦我尝试将 spring boot maven 插件版本升级到高于 1.0.1 的版本,应用程序就不会在任何调试断点处停止。

在开发过程中,我们发现了问题,我们不得不在 Spring Boot 父 1.1.9 上回退到 1.0.1,我只能猜测这种决定的风险是什么。

 <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>1.1.9.RELEASE</version>
                <!-- <version>1.0.1.RELEASE</version> works flawlessly-->
            </plugin>
        </plugins>
    </build>

http://docs.spring.io/spring-boot/docs/current/maven-plugin/examples/run-debug.html - 这个链接从来没有帮助过。应用程序只是无限期挂起等待。

如果您仅通过调试应用程序类在默认配置文件中运行,则有一种解决方法,但是在这种情况下我无法配置任何其他内容。

演示调试器如何未能在第一个断点处停止而应用程序启动的屏幕截图。

【问题讨论】:

    标签: java spring intellij-idea spring-boot


    【解决方案1】:

    目标 spring-boot:run forks java 进程,您的应用程序在另一个进程中启动,然后附加调试器。您必须使用该页面http://docs.spring.io/spring-boot/docs/current/maven-plugin/examples/run-debug.html 为分叉进程设置正确的调试参数,然后使用 IntelliJ 的“远程调试”功能。

    【讨论】:

    • Spring Boot 1.2 将默认行为更改为不再形成(除非您使用 Spring Loaded)。所以你也可以尝试升级。
    • 谢谢两位。确认 1.2.0.RC2 与 1.0.1 RELEASE 相同。等待发布的时间很长吗?
    • 2020年链接为404
    【解决方案2】:

    Run/Debug Configuration中的VM options设置为:

    -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005

    图片:https://i.stack.imgur.com/BIKdl.png

    【讨论】:

      【解决方案3】:
      annotate those is ok:
      <!-- <configuration>
                      <jvmArguments>-Djava.rmi.server.hostname=localhost -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments>
                  </configuration>
                  <dependencies>
                      <dependency>
                          <groupId>org.springframework</groupId>
                          <artifactId>springloaded</artifactId>
                          <version>1.2.3.RELEASE</version>
                      </dependency>
                  </dependencies>-->
      

      【讨论】:

        猜你喜欢
        • 2014-04-03
        • 1970-01-01
        • 2017-07-20
        • 2014-01-14
        • 1970-01-01
        • 2021-11-04
        • 2018-02-20
        • 2014-07-17
        • 1970-01-01
        相关资源
        最近更新 更多