Confirm. Problem was that I try to debug using maven run configuration. Switching to Application configuration type helps. I've spend half of a day on it (

Answer from Andriy Yarish on Stack Overflow
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 6796164198546-Intellij-not-stopping-at-breakpoints
Intellij not stopping at breakpoints – IDEs Support (IntelliJ Platform) | JetBrains
If you really need to use Maven goal for debugging you need to add debug arguments to the process which runs the boot run maven goal, see https://docs.spring.io/spring-boot/docs/2.0.3.RELEASE/maven-plugin/examples/run-debug.html And then connect ...
Discussions

java - Intellij debugger does not stop at breakpoints - Stack Overflow
I must be doing something wrong here. I am new to intellij. Making switch from eclipse. I have a JAX WS application that runs on weblogic. The artifact to deploy is an ear file. I have been struggl... More on stackoverflow.com
🌐 stackoverflow.com
java - How to debug spring-boot application with IntelliJ IDEA community Edition? - Stack Overflow
I'm having difficulties in debugging a Java spring-boot application on IntelliJ IDEA community Edition. The main problem is, that the IDE won't stop on a breakpoint, even the program surely executes More on stackoverflow.com
🌐 stackoverflow.com
spring boot - Cannot debug / stop a springboot app with IntelliJ Idea community - Stack Overflow
My Idea setup cannot stop on breakpoints and not even stop the launched/debugged process. Environment: ubuntu 20.04.1 LTS openjdk version "1.8.0_275" 64 bit IntelliJ Idea 2020.2 Steps to More on stackoverflow.com
🌐 stackoverflow.com
IntelliJ debugger no longer stops at breakpoints
Just a stab in the dark, but did you re-select and run your remote debug run configuration? IntelliJ retains the last run config, regardless of how it was executed. If not, you need to provide a lot more detail. That SO post is likely to get removed for lack of detail and being possibly off-topic (IDE-specific). More on reddit.com
🌐 r/IntelliJIDEA
5
6
February 8, 2023
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 12637593520402-Breakpoints-not-working-in-spring-boot-app
Breakpoints not working in spring boot app – IDEs Support (IntelliJ Platform) | JetBrains
When I debug sprint boot project, program does not stop on breakpoints, it continues to run as if no breakpoints were set. What is causing this issue? The project is maven based and is configured to use sprint-boot:run command when the project is run (click on play button on top right of the IDE. to debug I click on bug icon on top right. ... Hi, The Maven `sprint-boot:run` runs the app in a forked process which can be debugged from the IDEA side directly.
Top answer
1 of 4
10

I figured out what my issue was and I think the problem is specific to me and the nature of my application. Actually I should call it a self induced issue. Let me explain the nature of events.

  1. I have been using eclipse to develop and have a local install of weblogic instance. My application needs coherence cache server and I have few other JVM parameters that I pass when starting the domain. Therefore I had added a line at the start of the $DOMAIN_HOME/bin/setDomainEnv.sh file like so

    JAVA_OPTIONS="- Dtangosol.coherence.distributed.localstorage=false -Dtangosol.coherence.wka=devmachine and blah blah blah

  2. I switched to intellij and started working on this project and then configured the weblogic plugin and run configuration etc.

  3. I noticed that intellij adds a JAVA_OPTIONS in the startup/connection tab in Run/Debug Configurations like so

  1. However the JAVA_OPTIONS that was being passed by intellij was not being used by weblogic. I believe it was overridden with what was in the setDomainEnv.sh which is why I saw the following logs.

java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode) Starting WLS with line: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -client -Xms512m -Xmx512m -XX:MaxPermSize=256m -Dweblogic.Name=AdminServer -Djava.security.policy=/Users/dparupud/omw/oracle/middleware/weblogic_10.3.6/wlserver_10.3/server/lib/weblogic.policy -Dtangosol.coherence.distributed.localstorage=false -Dtangosol.coherence.wka=devmachine blah blah blah......

  1. When I went and removed the JAVA_OPTIONS from setDomainEnv.sh and restarted the server from intellij I saw the following log

starting weblogic with Java version: java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode) Starting WLS with line: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -client -Xms512m -Xmx512m -XX:MaxPermSize=256m -Dweblogic.Name=AdminServer -Djava.security.policy=/Users/dparupud/omw/oracle/middleware/weblogic_10.3.6/wlserver_10.3/server/lib/weblogic.policy - agentlib:jdwp=transport=dt_socket,address=127.0.0.1:65501,suspend=y,server=n

Now the log showed that the jdwp agent was in action. I did notice that I did not see that particular log before I asked the Question on SO but I thought maybe IntelliJ was doing something inside the covers because JAVA_OPTIONS was being passed and intellij does not allow you to mess with that ( it is readonly).

I guess I can either pass all my jvm parameters either from intellij or add the jdwp agent info in the setDomainEnv.sh.

Now I am able to debug.

2 of 4
5

To setup WebLogic debugging on IntelliJ:

  1. Find the WebLogic Debug Port: this is the port on WebLogic exposed for debugging. The default debug port is 8453 but if it was changed you can find it in the config.xml (under the config folder in your domain home) or the setDomainEnv.sh look for DEBUG_PORT (I assume it is .sh and not .bat as you appear to be using Mac OS X).

  2. Remote Debugger Configuration: go to the configuration and choose new, then select "Remote" ,type in any name that is sensible and under the port (orange block in image) type in the value you found in 1. For host (the green block) type localhost [a side note: you can connect to a remote server by typing that servers host name or IP if the debug port is exposed].

  3. Start debugger: Start the debug configuration you just setup, the debug window will pop up and if the port is correct it will say it has connected to remote host and you are good to go debugging.

--Edit 1--

Read your question again missed the part about you already having setup the remote config.

It may be missing the breakpoint if your program is multi-threaded the breakpoint may not be hit on the current thread you are on.

There is a drop down in the debugger when you have the remote configuration working where you should be able to select the thread to debug on.

-- Edit 2 --

Added the image for the remote debugger settings

🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360009815040-Intellij-debugger-does-not-stop-at-breakpoint-until-the-debugger-is-restarted
Intellij debugger does not stop at breakpoint until the debugger is restarted – IDEs Support (IntelliJ Platform) | JetBrains
October 10, 2020 - I am using Intellij Idea Ultimate on macOS. I am trying to debug a remote Spring boot application. The debugger sometimes doesn't stop at the breakpoint. I have to restart the debugger to make it s...
Top answer
1 of 13
213

EDIT: it does not work anymore from Spring Boot 3+. See Ruik's comment


tldr: You can try tweaking the command line like this:

spring-boot:run -Dspring-boot.run.fork=false

Explanation:

When running the application in debug mode, the IntelliJ debugger attaches to the Java process that it starts itself (by appending the appropriate parameters, -agentlib:jdwp etc, to the Java command line).

Quite often, these Java processes might then fork a new instance, which is not getting the same parameters, and because it is in a separate process, is not connected to the debugger. This can be confusing.

The spring-boot:run Maven goal, in addition to forking a new JVM, creates even more confusion, because it sometimes does fork and sometimes doesn't, depending on the options it gets, among other things. Some of this can be found in the documentation, but it's not always obvious.

You should first check whether the Java process actually is being debugged at all. When you start the application from IntelliJ, you will see messages scrolling by in the Run / Debug tab. At the top, there's the command line that is being executed. It should contain the debugger parameters (-agentlib:jdwp etc) and it should be followed by a message saying "Connected to the target VM", which is the debugger confirming that it has contact.

Next, if you are unsure if the JVM has been forked, you can check the process list in your OS, for example under MacOS and *nix you can use ps aux | grep java. The Java processes typically have a giant parameter list, most of which is the class path. The actual application being run is at the very end of the command line. If the JVM was forked, you have the process running the Maven goal, and another one running the Spring application. Then your debugger will be connected to the process you are not interested in, and your breakpoints won't work.

To stop spring-boot:run from forking, you can use the fork parameter above.

2 of 13
109

The only approach that worked for me, is running or debugging application directly from Intellij Idea. Just open class which contains

 public static void main(String[] args) {
        SpringApplication.run(MyApp.class, args);
    }

And click right mouse button->Debug my application

Find elsewhere
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 10000635378450-IntelliJ-debugger-no-longer-stops-at-breakpoints
IntelliJ debugger no longer stops at breakpoints – IDEs Support (IntelliJ Platform) | JetBrains
February 8, 2023 - Use TcpView to ensure it's a correct Tomcat instance listening for debugger on port 8000. Make a change in your code like adding a logging statement, put a breakpoint on this line, build/deploy the new app, restart Tomcat.
🌐
Reddit
reddit.com › r/intellijidea › intellij debugger no longer stops at breakpoints
r/IntelliJIDEA on Reddit: IntelliJ debugger no longer stops at breakpoints
February 8, 2023 -

Using IntelliJ Community Edition 2022.3.2 for Windows, I was debugging just fine until I decided to run some unit tests manually by going to the file in the proyect explorer, double clicking it and selecting "run". As a result, the debugger (Remote JVM Debug) no longer stops at breakpoints.

My best guess is that running the unit test created another JVM or Java Project and the debugger attachs to it whenever I run it but I tried restarting my PC to kill all processes and did´t work. Also tried uninstalling Tomcat and IntelliJ because I notice that before running the unit test, it built the proyect and that´s something I never do using the IntelliJ Build Project tool, I always do it via CMD

I created a post in StackOverflow but got no answer. Pelase feel free to check the post asi i added a lot more information there.

Any kind of information or workaround I can try is welcome, i have been struggling with this issue for 2 days now.

🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360009993679-Spring-boot-app-doesn-t-stop-on-breakpoints-and-doesn-t-kill-process-after-stopping
Spring boot app - doesn't stop on breakpoints and doesn't kill process after stopping – IDEs Support (IntelliJ Platform) | JetBrains
So today, my spring boot app doesn't stop on breakpoints, and when I need to re-run it with gradle's bootRun task, previously running instance is not stopped automatically - and because they use some shared recourse, I have to kill it manually. ... Hello. Does it help if you remove .idea folder and reimport the project? ... Hi In fact, yes and no. I checked out repo from scratch, changed run/build "with intellij" instead of "with gradle" and also in debug configuration -> added "debug all tasks" in "gradle debug" tab.
🌐
JetBrains
youtrack.jetbrains.com › issue › IDEA-296707 › Debugging-tests-from-IntelliJ-202132-does-not-stop-at-breakpoints
Debugging tests from IntelliJ 2021.3.2 does not stop at ...
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
🌐
Stack Overflow
stackoverflow.com › questions › 63814541 › spring-boot-application-doesnt-stop-at-any-breakpoint-in-debug
java - Spring Boot application doesn't stop at any breakpoint in debug - Stack Overflow
Then I put a breakpoint at string System.out.println("stop");. Invoked again controller's method. And I can see again stop string in the log instead of stopping at breakpoint.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360001580439-Not-able-to-hit-a-breakpoint-in-IntelliJ-when-trying-to-remote-debug-a-executing-test
Not able to hit a breakpoint in IntelliJ when trying to remote debug a executing test – IDEs Support (IntelliJ Platform) | JetBrains
November 16, 2018 - I have created a remote debug configuration in IntelliJ with port as 5005 · I am running this command: gradle test -Dtest.debug on command line · I see build output that the build is waiting for the debugger to connect to port 5005 and the process suspends · At this point I run my remote debug configuration and it successfully connects to port 5005 · After this the JUnit test is executed but the debugger does not stop at the breakpoints.
🌐
tutorialpedia
tutorialpedia.org › blog › how-to-debug-spring-boot-application-with-intellij-idea-community-edition
Debugging Spring Boot in IntelliJ IDEA Community Edition: How to Fix Breakpoints Not Stopping (Maven Configuration) — tutorialpedia.org
... Check for Port Conflicts: Ensure port 5005 (or your custom port) isn’t blocked by a firewall or used by another process. Run netstat -tulpn | grep 5005 (Linux/macOS) or netstat -ano | findstr :5005 (Windows) to check.
🌐
JetBrains
youtrack.jetbrains.com › issue › IDEA-252635
Debug did not stop on breakpoint for Spring Boot Application ...
November 19, 2020 - {{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
🌐
JetBrains
youtrack.jetbrains.com › issue › idea-86465
Debugger does not stop at break points : IDEA-86465
July 1, 2020 - {{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
🌐
DEV Community
dev.to › davey › debugging-springboot-application-in-intellij-idea-ce-22j9
Debugging SpringBoot Application In IntelliJ Idea CE - DEV Community
October 12, 2022 - When debugging a SpringBoot application in IntelliJ Idea Community Edition, additional steps need to be taken. If you have defined your run configuration as spring-boot:run, you will find that the application runs, but does not stop at breakpoints as expected.
🌐
Coderanch
coderanch.com › t › 769783 › intellij-idea › ide › spring-boot-run-hit-break
spring-boot:run cannot hit break point (IntelliJ IDEA forum at Coderanch)
in run configuration, I choose Maven and set run command as spring-boot:run, then I set break point in code and run the configuration, but I find intellij cannot hit the break point. but if I create another run configuration, choose Application and set the main class, then when run this configuration, Intellij can hit the break point. 1) why if using spring-boot:run to run, Intellij cannot hit the break point? 2) how to make Intellij can also hit the break point even using spring-boot:run to run? ... IntelliJ works by connecting to the debugger that is built into the JVM.