[jboss-cvs] JBossAS SVN: r96392 - projects/naming/branches/Branch_5_0/jnpserver/src/main/java/org/jnp/interfaces.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Nov 15 21:28:57 EST 2009


Author: scott.stark at jboss.org
Date: 2009-11-15 21:28:57 -0500 (Sun, 15 Nov 2009)
New Revision: 96392

Modified:
   projects/naming/branches/Branch_5_0/jnpserver/src/main/java/org/jnp/interfaces/NamingContext.java
Log:
JBNAME-2, add the full discovery failure trace to the naming exception.


Modified: projects/naming/branches/Branch_5_0/jnpserver/src/main/java/org/jnp/interfaces/NamingContext.java
===================================================================
--- projects/naming/branches/Branch_5_0/jnpserver/src/main/java/org/jnp/interfaces/NamingContext.java	2009-11-16 02:26:09 UTC (rev 96391)
+++ projects/naming/branches/Branch_5_0/jnpserver/src/main/java/org/jnp/interfaces/NamingContext.java	2009-11-16 02:28:57 UTC (rev 96392)
@@ -24,6 +24,8 @@
 import java.io.BufferedInputStream;
 import java.io.IOException;
 import java.io.ObjectInputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.lang.ref.WeakReference;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
@@ -1761,7 +1763,12 @@
                   StringBuffer buffer = new StringBuffer(50);
                   buffer.append("Could not obtain connection to any of these urls: ").append(urls);
                   if (discoveryFailure != null)
-                     buffer.append(" and discovery failed with error: ").append(discoveryFailure);
+                  {
+                     StringWriter sw = new StringWriter();
+                     PrintWriter pw = new PrintWriter(sw);
+                     discoveryFailure.printStackTrace(pw);
+                     buffer.append(" and discovery failed with error: ").append(sw.toString());
+                  }
                   CommunicationException ce = new CommunicationException(buffer.toString());
                   ce.setRootCause(serverEx);
                   throw ce;




More information about the jboss-cvs-commits mailing list