diff --git a/src/main/java/com/eactive/apim/portal/apps/ReadinessController.java b/src/main/java/com/eactive/apim/portal/apps/ReadinessController.java index 230d425..13b47e2 100644 --- a/src/main/java/com/eactive/apim/portal/apps/ReadinessController.java +++ b/src/main/java/com/eactive/apim/portal/apps/ReadinessController.java @@ -5,6 +5,7 @@ import java.sql.SQLException; import javax.sql.DataSource; +import org.jboss.logging.Logger; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -12,19 +13,28 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.thymeleaf.spring5.SpringTemplateEngine; +import com.google.common.util.concurrent.Futures; + /** * Readiness probe. * *
Distinct from {@link HealthCheckController} (liveness — servlet alive?). * This endpoint validates both EMS and Gateway datasources via JDBC - * {@code Connection.isValid(timeout)}, and the Thymeleaf {@link SpringTemplateEngine} - * configuration, to confirm the app is ready to serve real page requests. + * {@code Connection.isValid(timeout)}, plus three libraries that WebLogic's + * oracle_common bundles at a different version from this app (see weblogic.xml + * {@code prefer-application-packages}): Thymeleaf's {@link SpringTemplateEngine} + * (jackson), jboss-logging, and Guava. * - *
The template-engine check exists because this controller bypasses view - * resolution entirely (plain {@code @RestController} JSON) — a broken - * {@code TemplateEngine.getConfiguration()} (e.g. classpath split causing - * {@link java.util.ServiceConfigurationError} during dialect/module discovery) - * previously left every real page returning 500 while this probe still reported 200. + *
These exist because this controller bypasses view resolution entirely + * (plain {@code @RestController} JSON) — a classpath split between the app's + * copy and WebLogic's bundled copy of a preferred package can throw + * {@link LinkageError}/{@link java.util.ServiceConfigurationError} only on the + * real code paths that touch it, while this probe kept reporting 200. That + * already happened once for jackson (Thymeleaf's dialect/module discovery + * failed on every real page while /health/ready stayed green) — jboss-logging + * and Guava carry the same risk (confirmed version mismatch against + * oracle_common, not yet observed failing in production) so they get the same + * kind of forced-touch check here. * *
HTTP 200 + JSON when all checks pass. *
HTTP 503 + JSON when any check fails — body still includes the per-component
@@ -50,16 +60,21 @@ public class ReadinessController {
@GetMapping(value = "/health/ready", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity