spring-projects/spring-boot · error · IllegalStateException

Unexpected: attribute 'Ready' not available

Error message

Unexpected: attribute 'Ready' not available

What it means

In isReady(), the client queries the lifecycle MBean's 'Ready' attribute. AttributeNotFoundException means an MBean is registered under the expected objectName but does not expose a 'Ready' attribute, which violates the internal contract with Spring Boot's SpringApplicationAdminJmxAutoConfiguration that should always expose it. Treated as an unrecoverable programmer/environment error (IllegalStateException).

Solutions

  1. Verify the running application is genuinely a Spring Boot app started by spring-boot-maven-plugin
  2. Ensure no other process is bound to the configured jmxPort
  3. Align the spring-boot-maven-plugin version with the application's Spring Boot version
Defensive patterns

Strategy: try-catch

Validate before calling

// Confirm the bean exposes the Ready attribute before polling
MBeanAttributeInfo[] infos = connection.getMBeanInfo(objectName).getAttributes();
boolean hasReady = Arrays.stream(infos).anyMatch(i -> "Ready".equals(i.getName()));
if (!hasReady) { /* not a Spring Boot admin bean */ }

Try / catch

try { boolean ready = client.isReady(); } catch (IllegalStateException ex) { /* contract violation -- treat as fatal misconfig */ log.warn("Not a Spring Boot lifecycle bean at {}", objectName, ex); }

Prevention

When it happens

Trigger: A non-Spring-Boot (or differently-versioned) application registered an MBean at the expected objectName; or a stale Spring Boot version whose admin bean lacks the Ready attribute.

Common situations: Port reuse where another JVM answers at the jmxPort; custom ApplicationAdmin that does not extend Spring Boot's lifecycle; plugin/application Spring Boot version mismatch where the bean schema changed.

Related errors


AI-assisted analysis of spring-projects/spring-boot@270dfe353f (2026-08-11). Data as JSON: /api/errors/d6e439954b5a89d1. Report an issue: GitHub.

Appendix: source

Thrown at build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/SpringApplicationAdminClient.java:69

		this.objectName = toObjectName(jmxName);
	}

	/**
	 * Check if the spring application managed by this instance is ready. Returns
	 * {@code false} if the mbean is not yet deployed so this method should be repeatedly
	 * called until a timeout is reached.
	 * @return {@code true} if the application is ready to service requests
	 * @throws MojoExecutionException if the JMX service could not be contacted
	 */
	boolean isReady() throws MojoExecutionException {
		try {
			return (Boolean) this.connection.getAttribute(this.objectName, "Ready");
		}
		catch (InstanceNotFoundException ex) {
			return false; // Instance not available yet
		}
		catch (AttributeNotFoundException ex) {
			throw new IllegalStateException("Unexpected: attribute 'Ready' not available", ex);
		}
		catch (ReflectionException ex) {
			throw new MojoExecutionException("Failed to retrieve Ready attribute", ex.getCause());
		}
		catch (MBeanException | IOException ex) {
			throw new MojoExecutionException(ex.getMessage(), ex);
		}
	}

	/**
	 * Stop the application managed by this instance.
	 * @throws MojoExecutionException if the JMX service could not be contacted
	 * @throws IOException if an I/O error occurs
	 * @throws InstanceNotFoundException if the lifecycle mbean cannot be found
	 */
	void stop() throws MojoExecutionException, IOException, InstanceNotFoundException {
		try {
			this.connection.invoke(this.objectName, "shutdown", null, null);

View on GitHub (pinned to 270dfe353f)