{"record":{"id":"e6aaaed75d0522cf","repo":"spring-projects/spring-boot","slug":"spring-application-did-not-start-before-the-config","errorCode":null,"errorMessage":"Spring application did not start before the configured timeout ({}ms)","messagePattern":"Spring application did not start before the configured timeout \\((.+?)ms\\)","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":219,"sourceCode":"\t\tgetLog().debug(\"Waiting for spring application to start...\");\n\t\tfor (int i = 0; i < maxAttempts; i++) {\n\t\t\tT result = callback.call();\n\t\t\tif (result != null) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tString message = \"Spring application is not ready yet, waiting \" + wait + \"ms (attempt \" + (i + 1) + \")\";\n\t\t\tgetLog().debug(message);\n\t\t\tsynchronized (this.lock) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.lock.wait(wait);\n\t\t\t\t}\n\t\t\t\tcatch (InterruptedException ex) {\n\t\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\t\tthrow new IllegalStateException(\"Interrupted while waiting for Spring Boot app to start.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthrow new MojoExecutionException(\n\t\t\t\t\"Spring application did not start before the configured timeout (\" + (wait * maxAttempts) + \"ms\");\n\t}\n\n\t@Override\n\tprotected TestClasspath testClasspath() {\n\t\tif (this.resolvedTestClasspath == null) {\n\t\t\tif (this.useTestClasspath != null) {\n\t\t\t\tgetLog().warn(\"useTestClasspath is deprecated, use testClasspath instead.\");\n\t\t\t\tthis.resolvedTestClasspath = (this.useTestClasspath) ? TestClasspath.DEPENDENCIES : TestClasspath.OFF;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.resolvedTestClasspath = TestClasspath.valueOf(this.testClasspath.toUpperCase(Locale.ROOT));\n\t\t\t}\n\t\t}\n\t\treturn this.resolvedTestClasspath;\n\t}\n\n\tprivate class CreateJmxConnector implements Callable<@Nullable JMXConnector> {","sourceCodeStart":201,"sourceCodeEnd":237,"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#L201-L237","documentation":"After exhausting all maxAttempts retries of isReady() (each returning null/false), the plugin gives up and reports the configured budget as wait*maxAttempts ms. The application launched a JVM but never reached readiness within the configured window.","triggerScenarios":"Application startup slower than wait*maxAttempts ms: long context init, slow DB migrations, blocking remote dependency waits.","commonSituations":"Cold start with many beans; slow external config server; profiling/debug agent slowing JVM; large classpath scanning.","solutions":["Increase <wait> and/or <maxAttempts> to exceed the worst-case startup time","Profile and optimize startup (lazy init, narrower component scan, fewer auto-configurations)","Pre-warm slow dependencies (DB pool, schema migration) before invoking spring-boot:run"],"exampleFix":"<!-- before -->\n<maxAttempts>20</maxAttempts>\n<!-- after -->\n<maxAttempts>120</maxAttempts>","handlingStrategy":"validation","validationCode":"// Estimate startup budget before running\nlong budgetMs = (long) wait * maxAttempts;\nif (budgetMs < expectedWorstCaseStartupMs) { /* raise wait or maxAttempts */ }","typeGuard":null,"tryCatchPattern":"try { waitForSpringApplication(); } catch (MojoExecutionException ex) { log.error(\"App did not become ready in {}ms; increase <wait>/<maxAttempts> or optimize startup\", wait*maxAttempts); throw ex; }","preventionTips":["Size wait*maxAttempts to the observed worst-case startup time plus margin","Optimize startup (lazy init, narrower scan, fewer auto-configurations)","Pre-warm slow dependencies before invoking spring-boot:run"],"tags":["startup","timeout","maven-plugin"],"backgroundTag":null,"analyzedSha":"270dfe353fb830fd69b823a8a859287ff103854b","analyzedAt":"2026-08-11T19:42:06.541Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}