Object o = namespace.get(name);
if (o == null) {
throw new NameNotFoundException("No object bound to name " + name);
} else {
if (o instanceof NamingObjectProxy) {
NamingObjectProxy namingProxy = (NamingObjectProxy) o;
InitialContext ic = initialContext;
if(env != null){
ic = new InitialContext(env);
}
o = namingProxy.create(ic);
} else if (o instanceof Reference) {
try {
o = getObjectInstance(name, o, env);
} catch (Exception e) {
_logger.log(Level.FINEST,"Unable to get Object instance from Reference for name ["+name+"]. " +