Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Broken Spring Boot Debugging process - ignoring breakpoints

I've encountered the same issue twice. As soon as I try to upgrade the spring boot maven plugin version to something greater than 1.0.1 release the application does not stop on any of the debug breakpoints.

During the development we identified the problem and we had to fallback to 1.0.1 while being on Spring Boot parent 1.1.9 What are the risks of such decision I can only guess.

 <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 - this link never helped. The application just hangs waiting infinitely.

There is a workaround if you are running in default profile just by debugging the application class, but hey I can't configure anything else in this case.

Screenshot demonstrating how the debugger failed to stop on the very first breakpoint and application started instead.

Screen

like image 990
Aubergine Avatar asked Nov 30 '14 01:11

Aubergine


People also ask

Why are my breakpoints not working?

If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.

What happens when a breakpoint is reached when the debugger is enabled?

If a breakpoint is reached, or a signal not related to stepping occurs before count steps, stepping stops right away. Continue to the next source line in the current (innermost) stack frame. This is similar to step , but function calls that appear within the line of code are executed without stopping.

Does breakpoint stop all threads?

By default only the thread that hits the breakpoint stops. However, you can modify the behavior by changing the breakpopint properties. Save this answer.


1 Answers

The goal spring-boot:run forks java process and your application is started in the other one then your debugger is attached. You have to use that page http://docs.spring.io/spring-boot/docs/current/maven-plugin/examples/run-debug.html to setup correct debugging parameters for forked process and then use IntelliJ's feature "Remote Debug".

like image 87
chalimartines Avatar answered Oct 27 '22 08:10

chalimartines