public Object doInContext(Context ctx) throws NamingException {
                Object located = ctx.lookup(name);
                if (located == null) {
                    throw new NameNotFoundException(
                            "JNDI object with [" + name + "] not found: JNDI implementation returned null");
                }
                return located;
            }
Look up the object with the given name in the current JNDI context.

@param name the JNDI name of the object
@return object found (cannot be <code>null</code>; if a not so well-behaved
JNDI implementations returns null, a NamingException gets thrown)
@throws NamingException if there is no object with the given
                        name bound to JNDI
core/src/main/java/org/apache/shiro/jndi/JndiTemplate.java