[jboss-cvs] JBossAS SVN: r83568 - projects/microcontainer/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jan 28 11:29:02 EST 2009


Author: david.lloyd at jboss.com
Date: 2009-01-28 11:29:01 -0500 (Wed, 28 Jan 2009)
New Revision: 83568

Modified:
   projects/microcontainer/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/AbstractKernelDeployer.java
Log:
Humanize the deployment error messages

Modified: projects/microcontainer/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/AbstractKernelDeployer.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/AbstractKernelDeployer.java	2009-01-28 16:28:42 UTC (rev 83567)
+++ projects/microcontainer/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/AbstractKernelDeployer.java	2009-01-28 16:29:01 UTC (rev 83568)
@@ -217,22 +217,21 @@
             buffer.append("Incompletely deployed:\n");
             if (errors.size() != 0)
             {
-               buffer.append("\n*** DEPLOYMENTS IN ERROR: Name -> Error\n");
+               buffer.append("\nDEPLOYMENTS IN ERROR:\n");
                for (ControllerContext ctx : errors)
                {
-                  buffer.append(ctx.getName()).append(" -> ").append(ctx.getError().toString()).append('\n');
+                  buffer.append(String.format("  Deployment \"%s\" is in error due to: %s\n", ctx.getName(), ctx.getError()));
                }
             }
             if (incomplete.size() != 0)
             {
-               buffer.append("\n*** DEPLOYMENTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}\n");
+               buffer.append("\nDEPLOYMENTS MISSING DEPENDENCIES:\n");
                for (ControllerContext ctx : incomplete)
                {
                   Object name = ctx.getName();
-                  buffer.append(name).append(" -> ");
+                  buffer.append(String.format("  Deployment \"%s\" is missing the following dependencies:\n", name));
                   DependencyInfo dependsInfo = ctx.getDependencyInfo();
                   Set<DependencyItem> depends = dependsInfo.getIDependOn(null);
-                  boolean first = true;
                   for (DependencyItem item : depends)
                   {
                      ControllerState dependentState = item.getDependentState();
@@ -262,29 +261,18 @@
 
                         if (print)
                         {
-                           if (first)
-                              first = false;
-                           else
-                              buffer.append(", ");
-
-                           buffer.append(iDependOn).append('{').append(dependentState.getStateString());
-                           buffer.append(':');
-                           if (iDependOn == null)
-                           {
-                              buffer.append("** UNRESOLVED " + item.toHumanReadableString() + " **");
-                           }
-                           else
-                           {
-                              if (other == null)
-                                 buffer.append("** NOT FOUND **");
-                              else
-                                 buffer.append(otherState.getStateString());
-                           }
-                           buffer.append('}');
+                           buffer.append(String.format("    Dependency \"%s\" (should be in state \"%s\", but is actually %s)\n",
+                                   iDependOn,
+                                   dependentState.getStateString(),
+                                   iDependOn == null ?
+                                           String.format("unresolved (%s)",
+                                           item.toHumanReadableString()) :
+                                           other == null ?
+                                                   "not found" :
+                                                   String.format("in state \"%s\"", otherState.getStateString())));
                         }
                      }
                   }
-                  buffer.append('\n');
                }
             }
             throw new IllegalStateException(buffer.toString());




More information about the jboss-cvs-commits mailing list