{"record":{"id":"f3b7c6b74ed39dd5","repo":"spring-projects/spring-boot","slug":"unable-to-retrieve-ready-attribute","errorCode":null,"errorMessage":"Unable to retrieve 'ready' attribute","messagePattern":"Unable to retrieve 'ready' attribute","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java","lineNumber":183,"sourceCode":"\t\t}\n\t\tcatch (IOException ex) {\n\t\t\tthrow new MojoFailureException(\"Could not contact Spring Boot application via JMX on port \" + this.jmxPort\n\t\t\t\t\t+ \". Please make sure that no other process is using that port\", ex);\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tthrow new MojoExecutionException(\"Failed to connect to MBean server at port \" + this.jmxPort, ex);\n\t\t}\n\t}\n\n\tprivate void doWaitForSpringApplication(MBeanServerConnection connection)\n\t\t\tthrows MojoExecutionException, MojoFailureException {\n\t\tfinal SpringApplicationAdminClient client = new SpringApplicationAdminClient(connection, this.jmxName);\n\t\ttry {\n\t\t\tCallable<@Nullable Boolean> isReady = () -> (client.isReady() ? true : null);\n\t\t\texecute(this.wait, this.maxAttempts, isReady);\n\t\t}\n\t\tcatch (ReflectionException ex) {\n\t\t\tthrow new MojoExecutionException(\"Unable to retrieve 'ready' attribute\", ex.getCause());\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tthrow new MojoFailureException(\"Could not invoke shutdown operation\", ex);\n\t\t}\n\t}\n\n\t/**\n\t * Execute a task, retrying it on failure.\n\t * @param <T> the result type\n\t * @param wait the wait time\n\t * @param maxAttempts the maximum number of attempts\n\t * @param callback the task to execute (possibly multiple times). The callback should\n\t * return {@code null} to indicate that another attempt should be made\n\t * @return the result\n\t * @throws Exception in case of execution errors\n\t */\n\tpublic <T> T execute(long wait, int maxAttempts, Callable<@Nullable T> callback) throws Exception {\n\t\tgetLog().debug(\"Waiting for spring application to start...\");","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/spring-projects/spring-boot/blob/270dfe353fb830fd69b823a8a859287ff103854b/build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java#L165-L201","documentation":"In doWaitForSpringApplication, after the connector is open the plugin polls client.isReady() through the retry executor. ReflectionException escaping that poll is unwrapped: the lifecycle MBean exists but the underlying attribute access reflected an error. Reported as MojoExecutionException with the cause.","triggerScenarios":"The application lifecycle MBean's Ready getter could not be invoked reflectively (the MBean target threw).","commonSituations":"Application initialization partially failed but the admin bean is registered; classloader rotation between registration and read; the bean was being unregistered during the poll.","solutions":["Inspect ex.getCause() for the real failure","Check the application startup logs for early context failures","Increase <wait> if startup is slow and the bean is in a transient state"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { doWaitForSpringApplication(connection); } catch (MojoExecutionException ex) { Throwable root = ex.getCause(); log.error(\"Ready poll reflected an error: {}\", root); throw ex; }","preventionTips":["Inspect the unwrapped cause of ReflectionException","Check application startup logs for partial initialization failures","Increase <wait> if startup is slow and the bean is in a transient state"],"tags":["jmx","lifecycle","maven-plugin"],"backgroundTag":null,"analyzedSha":"270dfe353fb830fd69b823a8a859287ff103854b","analyzedAt":"2026-08-11T19:42:06.541Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}