JMX bean not found (fork is null) during stopping Spring Boot application

22 Views Asked by At

I have the following script

#!/bin/bash
cd ../../../configuration-service
mvn -e -X spring-boot:stop &>log.log &

Which is intended for stop the SpringBoot application , here is entire app (single java file)

@EnableConfigServer
@SpringBootApplication
public class ConfigurationServiceApplication {

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

and script fails with the following error:

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.2:stop (default-cli) on project configuration-service: Spring application lifecycle JMX bean not found (fork is null). Could not stop application gracefully: org.springframework.boot:type=Admin,name=SpringApplication -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.2:stop (default-cli) on project configuration-service: Spring application lifecycle JMX bean not found (fork is null). Could not stop application gracefully

full log is here: https://gist.githubusercontent.com/iva-nova-e-katerina/45c62a1ac941c0d618a18dc42f980a51/raw/4be33bd4212f7ea0bfbad061e861dbcba988e4c9/mvn%2520-e%2520-X%2520spring-boot:stop%2520&%253Elog.log%2520&

Please tell me how to stop this Spring Boot application. I need to terminate this service from another Spring Boot application (from another microservice)

I have tried mvn -e -X spring-boot:stop &>log.log & expecting graceful stop of SpringBoot application

0

There are 0 best solutions below