InitialContext initcontext = createContext();
if(mappedName != null && !mappedName.equals(""))
{
return initcontext.lookup(mappedName);
}
return lookupRecursive(fieldType, initcontext, initcontext.listBindings("/"));
}
//TODO No, no no: we must look up a known location from metadata, not search for a matching type in the whole JNDI tree
protected Object lookupRecursive(Class<?> fieldType, javax.naming.Context context,
NamingEnumeration<Binding> contextNames) throws Exception