jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wildes miranda oliveira <wildes.mira...@gmail.com>
Subject RepositoryAccessServlet does not use jndi.name property from bootstrap config ...
Date Thu, 11 Nov 2010 17:30:03 GMT
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;
        }
   }

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message