3

I am trying to debug the REST API I have built using maven, however, whenever I stop the debugger, it shows a message:

Disconnected from the target VM, address: '127.0.0.1:50047', transport: 'socket'

And the remote process still seems to be running:

enter image description here

Is there a way to fix it so that when I stop the debugger, the process also stops running?

here is my POM.xml file:

 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>jetbrains</groupId> <artifactId>ProductProject</artifactId> <version>1.0</version> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.3.RELEASE</version> </parent> <repositories> <repository> <id>spring-releases</id> <url>https://repo.spring.io/libs-release</url> </repository> </repositories> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>8</source> <target>8</target> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-autoconfigure</artifactId> <version>2.3.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot</artifactId> <version>2.3.3.RELEASE</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.12</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>5.2.8.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies> </project> 

run configuration has spring-boot:run in the command line field and working directory is my project folder

9
  • Can you verify by trying to access the given IP+Port? I'm not sure if this is expected behavior based on your maven script. Commented Sep 2, 2020 at 10:17
  • Most probably the red skull icon should terminate the instance. Commented Sep 2, 2020 at 10:19
  • I can still send a GET request to the port through postman and receive a response. Also if I try to rerun it, it says that the Port 8080 is already in use. Commented Sep 2, 2020 at 10:21
  • red skull icon doesn't seem to do anything when clicked Commented Sep 2, 2020 at 10:24
  • Can you provide your pom.xml and run configuration. Commented Sep 2, 2020 at 10:36

3 Answers 3

5

Enable "Kill the debug process immediately" option in "Settings (Preferences)| Build, Execution, Deployment | Debugger"

enter image description here

Sign up to request clarification or add additional context in comments.

3 Comments

Enabling "Kill the debug process immediately" did not solve the issue
@Kris which version of IDE you are using?
I am using 2020.1.3. version
2

SOLVED: Adding <version> 1.2.7.RELEASE </version> to the spring-boot-maven-plugin in the POM.xml seems to have fixed the issue. Read that it was something to do with forking.

Comments

0

Thanks @Nemanja, I found similar issue when debugging a program to delete some files.

I placed breakpoint before the delete operation and the debugger stopped there. Then I veryfied the file to delete was not the correct one, thus I stopped debugging.

However the file was deleted anyway !!

I cannot comment on the previous response, as I don't have enough reputation, but the answer provided by @Nemanja solved my issue, thus adding this as a warning of side effects if that option is not ticked.

IMO that should be default for new IntelliJ projects.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.