[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Those terrible error messages
david.lloyd@jboss.com
do-not-reply at jboss.com
Wed Jan 28 11:10:34 EST 2009
"alesj" wrote : Sure, go ahead.
| But this is not the only place this is done.
| Search Deployers code for similar error msg aka 'alien language'. ;-)
|
| You must fix them both or none. :-)
Ales, Ales, Ales. :-)
OK, I found some stuff in jboss-deployers-client-spi which I imagine is it. Here's that patch:
| Index: deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/IncompleteDeployments.java
| ===================================================================
| --- deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/IncompleteDeployments.java
| +++ deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/IncompleteDeployments.java
| @@ -30,6 +30,7 @@
| import java.util.Set;
| import java.util.TreeMap;
| import java.util.TreeSet;
| +import java.util.Iterator;
|
| /**
| * IncompleteDeployments.
| @@ -261,19 +262,18 @@
| // Display all the missing dependencies
| if (contextsMissingDependencies.isEmpty() == false)
| {
| - buffer.append("\n*** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}\n\n");
| + buffer.append("\nDEPLOYMENTS MISSING DEPENDENCIES:\n");
| for (Map.Entry<String, Set<MissingDependency>> entry : contextsMissingDependencies.entrySet())
| {
| String name = entry.getKey();
| - buffer.append(name).append("\n");
| + buffer.append(String.format(" Deployment \"%s\" is missing the following dependencies:\n", name));
| for (MissingDependency dependency : entry.getValue())
| {
| - buffer.append(" -> ").append(dependency.getDependency());
| - buffer.append('{').append(dependency.getRequiredState());
| - buffer.append(':').append(dependency.getActualState()).append("}");
| - buffer.append("\n");
| + buffer.append(String.format(" Dependency \"%s\" (should be in state \"%s\", but is actually in state \"%s\")\n",
| + dependency.getDependency(),
| + dependency.getRequiredState(),
| + dependency.getActualState()));
| }
| - buffer.append('\n');
|
| // It is not a root cause if it has missing dependencies
| rootCauses.remove(name);
| @@ -286,22 +286,19 @@
|
| if (rootCauses.isEmpty() == false)
| {
| - buffer.append("\n*** CONTEXTS IN ERROR: Name -> Error\n\n");
| + buffer.append("\nDEPLOYMENTS IN ERROR:\n");
| for (String key : rootCauses.keySet())
| {
| - buffer.append(key).append(" -> ");
| + buffer.append(String.format(" Deployment \"%s\" is in error due to the following reason(s): ", key));
| Set<String> values = rootCauses.get(key);
| - boolean first = true;
| - for (String value : values)
| - {
| - if (first == false)
| - buffer.append(" | ");
| - else
| - first = false;
| -
| - buffer.append(value);
| - }
| - buffer.append("\n\n");
| + Iterator<String> it = values.iterator();
| + while (it.hasNext())
| + {
| + buffer.append(it.next());
| + if (it.hasNext())
| + buffer.append(", ");
| + }
| + buffer.append("\n");
| }
| }
| contextsInErrorInfo = buffer.toString();
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4205305#4205305
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4205305
More information about the jboss-dev-forums
mailing list