You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2009/04/03 23:33:51 UTC

svn commit: r761807 - /geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewPortlet.java

Author: djencks
Date: Fri Apr  3 21:33:50 2009
New Revision: 761807

URL: http://svn.apache.org/viewvc?rev=761807&view=rev
Log:
GERONIMO-4599 We don't need to instantiate refs to get a view of the jndi tree

Modified:
    geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewPortlet.java

Modified: geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewPortlet.java?rev=761807&r1=761806&r2=761807&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewPortlet.java (original)
+++ geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewPortlet.java Fri Apr  3 21:33:50 2009
@@ -23,6 +23,7 @@
 import javax.naming.InitialContext;
 import javax.naming.NameClassPair;
 import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -348,7 +349,12 @@
             NamingEnumeration enumName = ctx.list("");
             while (enumName.hasMoreElements()) {
                 NameClassPair pair = (NameClassPair) enumName.next();
-                Object obj = ctx.lookup(pair.getName());
+                Object obj = null;
+                try {
+                    obj = ctx.lookup(pair.getName());
+                } catch (NamingException e) {
+                    //ignore.... not a context
+                }
                 if (obj instanceof Context) {
                     buildContextSub(node, (Context) obj, nodeCurr + "/"
                             + pair.getName());
@@ -371,7 +377,12 @@
         while (enum1.hasMoreElements()) {
             javax.naming.NameClassPair pair = (javax.naming.NameClassPair) enum1
                     .next();
-            Object obj = context.lookup(pair.getName());
+            Object obj = null;
+            try {
+                obj = context.lookup(pair.getName());
+            } catch (NamingException e) {
+                //ignore.... it wasn't a context
+            }
             if (obj instanceof Context) {
                 buildGlobal(tree, (Context) obj, parent + pair.getName());
             } else {