From 2a7369d568212f4f6ff40f2a8c91e43e5425bef6 Mon Sep 17 00:00:00 2001 From: Dando Date: Tue, 23 Aug 2022 20:05:13 +0800 Subject: [PATCH] add a minor changes to log the missing modules in SpringContextInstallStage (#1008) --- .../isle/stage/SpringContextInstallStage.java | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/sofa-boot-project/sofa-boot-core/isle-sofa-boot/src/main/java/com/alipay/sofa/isle/stage/SpringContextInstallStage.java b/sofa-boot-project/sofa-boot-core/isle-sofa-boot/src/main/java/com/alipay/sofa/isle/stage/SpringContextInstallStage.java index 3a05e0cd1..d81a66c95 100644 --- a/sofa-boot-project/sofa-boot-core/isle-sofa-boot/src/main/java/com/alipay/sofa/isle/stage/SpringContextInstallStage.java +++ b/sofa-boot-project/sofa-boot-core/isle-sofa-boot/src/main/java/com/alipay/sofa/isle/stage/SpringContextInstallStage.java @@ -62,7 +62,7 @@ public class SpringContextInstallStage extends AbstractPipelineStage { private static final int DEFAULT_REFRESH_TASK_QUEUE_SIZE = 1000; private static final int CPU_COUNT = Runtime.getRuntime() - .availableProcessors(); ; + .availableProcessors(); private final SofaModuleProperties sofaModuleProperties; @@ -156,18 +156,31 @@ private void outputModulesMessage(ApplicationRuntimeModel application) private String getErrorMessageByApplicationModule(ApplicationRuntimeModel application) { StringBuilder sbError = new StringBuilder(512); if (application.getDeployRegistry().getPendingEntries().size() > 0) { - sbError.append("\n").append(ErrorCode.convert("01-12000")).append(".)").append("(") + sbError.append("\n").append(ErrorCode.convert("01-12000")).append("(") .append(application.getDeployRegistry().getPendingEntries().size()) .append(") >>>>>>>>\n"); + + for (DependencyTree.Entry entry : application + .getDeployRegistry().getPendingEntries()) { + if (application.getAllDeployments().contains(entry.get())) { + sbError.append("[").append(entry.getKey()).append("]").append(" depends on ") + .append(entry.getWaitsFor()) + .append(", but the latter can not be resolved.").append("\n"); + } + } } - for (DependencyTree.Entry entry : application - .getDeployRegistry().getPendingEntries()) { - if (application.getAllDeployments().contains(entry.get())) { - sbError.append("[").append(entry.getKey()).append("]").append(" depends on ") - .append(entry.getWaitsFor()).append(", but the latter can not be resolved.") - .append("\n"); + if (application.getDeployRegistry().getMissingRequirements().size() > 0) { + sbError.append("Missing modules").append("(") + .append(application.getDeployRegistry().getMissingRequirements().size()) + .append(") >>>>>>>>\n"); + + for (DependencyTree.Entry entry : application + .getDeployRegistry().getMissingRequirements()) { + sbError.append("[").append(entry.getKey()).append("]").append("\n"); } + + sbError.append("Please add the corresponding modules.").append("\n"); } return sbError.toString();