spring-projects/spring-boot · error · MojoFailureException
Could not invoke shutdown operation
Error message
Could not invoke shutdown operation
What it means
Error "Could not invoke shutdown operation" thrown in spring-projects/spring-boot.
Source
Thrown at build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java:170
+ ". Please make sure that no other process is using that port", ex);
}
catch (Exception ex) {
throw new MojoExecutionException("Failed to connect to MBean server at port " + this.jmxPort, ex);
}
}
private void doWaitForSpringApplication(MBeanServerConnection connection)
throws MojoExecutionException, MojoFailureException {
final SpringApplicationAdminClient client = new SpringApplicationAdminClient(connection, this.jmxName);
try {
Callable<@Nullable Boolean> isReady = () -> (client.isReady() ? true : null);
execute(this.wait, this.maxAttempts, isReady);
}
catch (ReflectionException ex) {
throw new MojoExecutionException("Unable to retrieve 'ready' attribute", ex.getCause());
}
catch (Exception ex) {
throw new MojoFailureException("Could not invoke shutdown operation", ex);
}
}
/**
* Execute a task, retrying it on failure.
* @param <T> the result type
* @param wait the wait time
* @param maxAttempts the maximum number of attempts
* @param callback the task to execute (possibly multiple times). The callback should
* return {@code null} to indicate that another attempt should be made
* @return the result
* @throws Exception in case of execution errors
*/
public <T> T execute(long wait, int maxAttempts, Callable<@Nullable T> callback) throws Exception {
getLog().debug("Waiting for spring application to start...");
for (int i = 0; i < maxAttempts; i++) {
T result = callback.call();
if (result != null) {View on GitHub (pinned to 5b2dbdbb8b)
When it happens
Trigger: Thrown at build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java:170 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of spring-projects/spring-boot@5b2dbdbb8b (2026-08-04).
Data as JSON: /data/errors/fb01f376510760ab.json.
Report an issue: GitHub.