IntelliJ IDEA: Breakpoint not being hit, and is shown without the tick, just a red dot

后端 未结 10 441
北海茫月
北海茫月 2020-12-29 01:24

First of all, the most similar question that I found is this Intellij IDEA: Breakpoint not being hit, and is shown greyed out but that is not the exact same case.

I

相关标签:
10条回答
  • 2020-12-29 02:18

    I was also facing this issue and found that my tomcat configuration was not right.

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
        <scope>compile</scope>
    </dependency>
    

    The scope tag had value as "provided". Changed it to compile and it worked fine.

    0 讨论(0)
  • 2020-12-29 02:20

    Did some searching through IntelliJ Help PDF:
    Help Doc pg. 431

    Their documentation Describes the checkmark as "Shown at run-time when the breakpoint is recognized by the debugger as set on an executable code line."

    and the regular red dot as "Shown at design-time or during the debugging session when the class with such breakpoint is not yet loaded. "

    So it would seem that the line you're adding the breaking point to never gets executed. You can try stepping up line by line through the class to make sure the class is not getting hung up somewhere.

    Hope this helps

    0 讨论(0)
  • 2020-12-29 02:20

    I've encounter this problem a couple of times and its was due to a bug in my code; the IDE is not at fault. Breakpoints might not be hit due to various reasons like: not initializing objects, failing @BeforeEach methods etc. Try to take a step back and analyze your code and if any details are being missed out.

    0 讨论(0)
  • 2020-12-29 02:23

    Rebuild solved my problem.

    clean & rebuild
    

    Invalidates caches/restart if necessary

    0 讨论(0)
提交回复
热议问题