{"record":{"id":"d6e439954b5a89d1","repo":"spring-projects/spring-boot","slug":"unexpected-attribute-ready-not-available","errorCode":null,"errorMessage":"Unexpected: attribute 'Ready' not available","messagePattern":"Unexpected: attribute 'Ready' not available","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/SpringApplicationAdminClient.java","lineNumber":69,"sourceCode":"\t\tthis.objectName = toObjectName(jmxName);\n\t}\n\n\t/**\n\t * Check if the spring application managed by this instance is ready. Returns\n\t * {@code false} if the mbean is not yet deployed so this method should be repeatedly\n\t * called until a timeout is reached.\n\t * @return {@code true} if the application is ready to service requests\n\t * @throws MojoExecutionException if the JMX service could not be contacted\n\t */\n\tboolean isReady() throws MojoExecutionException {\n\t\ttry {\n\t\t\treturn (Boolean) this.connection.getAttribute(this.objectName, \"Ready\");\n\t\t}\n\t\tcatch (InstanceNotFoundException ex) {\n\t\t\treturn false; // Instance not available yet\n\t\t}\n\t\tcatch (AttributeNotFoundException ex) {\n\t\t\tthrow new IllegalStateException(\"Unexpected: attribute 'Ready' not available\", ex);\n\t\t}\n\t\tcatch (ReflectionException ex) {\n\t\t\tthrow new MojoExecutionException(\"Failed to retrieve Ready attribute\", ex.getCause());\n\t\t}\n\t\tcatch (MBeanException | IOException ex) {\n\t\t\tthrow new MojoExecutionException(ex.getMessage(), ex);\n\t\t}\n\t}\n\n\t/**\n\t * Stop the application managed by this instance.\n\t * @throws MojoExecutionException if the JMX service could not be contacted\n\t * @throws IOException if an I/O error occurs\n\t * @throws InstanceNotFoundException if the lifecycle mbean cannot be found\n\t */\n\tvoid stop() throws MojoExecutionException, IOException, InstanceNotFoundException {\n\t\ttry {\n\t\t\tthis.connection.invoke(this.objectName, \"shutdown\", null, null);","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/spring-projects/spring-boot/blob/270dfe353fb830fd69b823a8a859287ff103854b/build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/SpringApplicationAdminClient.java#L51-L87","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the running application is genuinely a Spring Boot app started by spring-boot-maven-plugin","Ensure no other process is bound to the configured jmxPort","Align the spring-boot-maven-plugin version with the application's Spring Boot version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Confirm the bean exposes the Ready attribute before polling\nMBeanAttributeInfo[] infos = connection.getMBeanInfo(objectName).getAttributes();\nboolean hasReady = Arrays.stream(infos).anyMatch(i -> \"Ready\".equals(i.getName()));\nif (!hasReady) { /* not a Spring Boot admin bean */ }","typeGuard":null,"tryCatchPattern":"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); }","preventionTips":["Validate the running application is a Spring Boot app before invoking JMX operations","Never share the jmxPort across concurrent builds","Keep the spring-boot-maven-plugin version aligned with the application's Spring Boot version"],"tags":["jmx","lifecycle","maven-plugin","contract-violation"],"backgroundTag":null,"analyzedSha":"270dfe353fb830fd69b823a8a859287ff103854b","analyzedAt":"2026-08-11T19:42:06.541Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}