geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1001150 - in /geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo: gbean/runtime/GBeanInstanceState.java kernel/config/ConfigurationUtil.java
Date Sat, 25 Sep 2010 06:53:41 GMT
Author: djencks
Date: Sat Sep 25 06:53:40 2010
New Revision: 1001150

URL: http://svn.apache.org/viewvc?rev=1001150&view=rev
Log:
Show all of all fail-to-start exceptions

Modified:
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java?rev=1001150&r1=1001149&r2=1001150&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java
Sat Sep 25 06:53:40 2010
@@ -24,6 +24,8 @@ import org.apache.geronimo.kernel.GBeanN
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.management.State;
 
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.util.Iterator;
 import java.util.Set;
 
@@ -281,7 +283,11 @@ public class GBeanInstanceState
 
             if (t instanceof Exception) {
                 // ignore - we only rethrow errors
-                gbeanInstance.setStateReason(t.getMessage());
+                StringWriter sw = new StringWriter();
+                PrintWriter pw = new PrintWriter(sw);
+                pw.append(t.getMessage()).append("\n");
+                t.printStackTrace(pw);
+                gbeanInstance.setStateReason(sw.toString());
                 return;
             } else if (t instanceof Error) {
                 throw (Error) t;

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java?rev=1001150&r1=1001149&r2=1001150&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
Sat Sep 25 06:53:40 2010
@@ -468,7 +468,7 @@ public final class ConfigurationUtil {
                     if (State.RUNNING_INDEX != kernel.getGBeanState(gbeanName)) {
                         String stateReason = null;
                         if (kernel instanceof BasicKernel) {
-                            stateReason = ((BasicKernel) kernel).getStateReason(gbeanName);
+                            stateReason = kernel.getStateReason(gbeanName);
                         }
                         String name = gbeanName.toURI().getQuery();
                         if (stateReason != null) {
@@ -481,8 +481,7 @@ public final class ConfigurationUtil {
                 if (!unstarted.isEmpty()) {
                     StringBuffer message = new StringBuffer();
                     message.append("Configuration ").append(configuration.getId()).append("
failed to start due to the following reasons:\n");
-                    for (Iterator iterator = unstarted.iterator(); iterator.hasNext();) {
-                        String reason = (String) iterator.next();
+                    for (String reason : unstarted) {
                         message.append("  ").append(reason).append("\n");
                     }
                     throw new InvalidConfigurationException(message.toString());



Mime
View raw message