The current JNDIView class found in the bin/jndiView.jar file of the latest
cvs snaphost does not handle References to Context that use object factories
that are not in its classpath gracefully. When it sees such an object it just exists
due to a ClassCastException. Enclosed is a context diff of JNDIView.java
that patches JNDIView to handle this without exiting so that the entire jndi
namespace is listed.

bash-2.04$ diff -c JNDIView.java JNDIView.java.new
*** JNDIView.java       Sat Oct  7 16:56:46 2000
--- JNDIView.java.new   Mon Jan  8 12:23:29 2001
***************
*** 100,106 ****
              System.out.println (_indent +  " +- " + pair.getName () +
                                  (verbose ? (" (class: "+pair.getClassName ()+")") : 
""));
              if (recursive)
!                listContext ((Context)_ctx.lookup (pair.getName ()), _indent 
+(ne.hasMore () ? " |  " : "    "));
           }
           ne.close ();
        }
--- 100,118 ----
              System.out.println (_indent +  " +- " + pair.getName () +
                                  (verbose ? (" (class: "+pair.getClassName ()+")") : 
""));
              if (recursive)
!             {
!                Context subctx = null;
!                String ctxName = pair.getName();
!                try
!                {
!                    subctx = (Context) _ctx.lookup(ctxName);
!                    listContext (subctx, _indent + (ne.hasMore () ? " |  " : "
   "));
!                }
!                catch(Throwable t)
!                {
!                    System.out.println("Failed to lookup: "+ctxName+" as a Cont
ext");
!                }
!             }
           }
           ne.close ();
        }



Reply via email to