location = getInitParameter(name);
} else if (!name.equals(Repository.class.getName())) {
environment.put(name, getInitParameter(name));
}
}
return new JNDIRepositoryFactory(
new InitialContext(environment), location).getRepository();
} catch (NamingException e) {
throw new RepositoryException(
"Repository not found: Invalid JNDI context", e);
}