Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring-Boot 2.2.0 process fails to terminate when launched in debug mode #18706

Closed
rmead opened this issue Oct 23, 2019 · 4 comments
Closed

Spring-Boot 2.2.0 process fails to terminate when launched in debug mode #18706

rmead opened this issue Oct 23, 2019 · 4 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@rmead
Copy link

rmead commented Oct 23, 2019

When running spring-boot 2.2.0 in debug mode in both Eclipse 2019-06 and IntelliJ 2019.2, attempts to terminate the process via the IDE look like they kill the process (per the IDE), however, the java process is still running (verified by ps -ef | grep java).

When running non debug mode in Eclipse, the process can be terminated but Eclipse displays a message stating "terminate failed".

I've tried all sorts of older post options including: -Dspring-boot:run.fork=false -Dfork=false

Running spring at cmd line using mvn spring-boot:run terminates normally with ctrl-c.

I'm using the following core dependencies in my pom:
spring-boot-starter-parent
spring-boot-starter-web
spring-boot-starter-jersey
spring-boot-starter-security

I'm not using any spring plugins in Eclipse. I'm using open jdk 11.0.3+7 on centos 7.

Everything worked normally in spring-boot 2.1.7, 2.1.8 and 2.1.9

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 23, 2019
@wilkinsona
Copy link
Member

As it appears you suspected, the problem is occurring because you are running the application via Maven, it is now forking a new JVM by default, and unlike your shell, your IDE is failing to terminate both the parent and child processes.

The correct system property to disable this behaviour is spring-boot.run.fork=false. Note that, generally speaking, we recommend invoking your application's main method directly in your IDE and only using spring-boot:run on the command line.

@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 23, 2019
@rmead
Copy link
Author

rmead commented Oct 23, 2019

Thanks for the response. I didn't realize I had a typo with a : vs a . between spring-boot.run which corrects my issue.

Is there documentation you can point me to explaining recommending invoking main from IDE vs using mvn goal spring-boot:run? I havent troubleshooted this yet but I've never been able to invoke main() directly without errors.

@rmead
Copy link
Author

rmead commented Oct 23, 2019

I found the documentation at this link but there is no mention of this in the what's new or release notes for spring-boot 2.2.0
https://docs.spring.io/spring-boot/docs/current/maven-plugin/usage.html#Running_the_application

@snicoll
Copy link
Member

snicoll commented Oct 23, 2019

@rmead there is an issue for that: #18638

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

4 participants