Hi, I am configuring RepositoryAccessServlet and found that it does not use
the jndi.name property as says commented on bootstrap.properties file.
bootstrap.properties
# JNDI Settings
# all properties starting with 'java.naming.' will go into the
# environment of the initial context
#jndi.enabled=true
# if the name is not specified, it's initialized with the repository.name
#jndi.name=${repository.name}
RepositoryAccessServlet.class
private Repository getRepositoryByJNDI() throws ServletException {
BootstrapConfig config = getConfig();
if (!config.getJndiConfig().isValid() ||
!config.getJndiConfig().enabled()) {
return null;
}
// acquire via JNDI
String repositoryName = config.getRepositoryName();
InitialContext ctx = getInitialContext();
if (ctx == null) {
return null;
}
try {
Repository r = (Repository) ctx.lookup(repositoryName);
log.info("Acquired repository via JNDI.");
return r;
} catch (NamingException e) {
log.error("Error while retrieving repository using JNDI
(name={})", repositoryName, e);
return null;
}
}