Skip to content

Commit

Permalink
add a minor changes to log the missing modules in SpringContextInstal…
Browse files Browse the repository at this point in the history
…lStage (#1008)
  • Loading branch information
crazysaltfish authored Aug 23, 2022
1 parent fe85f37 commit 2a7369d
Showing 1 changed file with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<String, DeploymentDescriptor> 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<String, DeploymentDescriptor> 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<String, DeploymentDescriptor> entry : application
.getDeployRegistry().getMissingRequirements()) {
sbError.append("[").append(entry.getKey()).append("]").append("\n");
}

sbError.append("Please add the corresponding modules.").append("\n");
}

return sbError.toString();
Expand Down

0 comments on commit 2a7369d

Please sign in to comment.