You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2008/02/27 10:34:04 UTC
svn commit: r631526 -
/incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java
Author: bdelacretaz
Date: Wed Feb 27 01:34:00 2008
New Revision: 631526
URL: http://svn.apache.org/viewvc?rev=631526&view=rev
Log:
Log Repository access failures at the INFO level to make troubleshooting easier
Modified:
incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java
Modified: incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java?rev=631526&r1=631525&r2=631526&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java (original)
+++ incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java Wed Feb 27 01:34:00 2008
@@ -63,11 +63,13 @@
public Repository getRepository(String repositoryName, Hashtable<String, Object> jndiContext) {
Repository result = null;
+ String tried = "";
if(jndiContext == null || jndiContext.size() == 0) {
log.info("jndiContext is null or empty, not trying JNDI");
} else {
log.debug("Trying to acquire Repository '" + repositoryName + "' via JNDI, context=" + jndiContext);
+ tried += "JNDI ";
final ClassLoader old = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
@@ -85,7 +87,7 @@
}
} catch (Throwable t) {
- log.debug("Unable to acquire Repository '" + repositoryName + "' via JNDI, context=" + jndiContext, t);
+ log.info("Unable to acquire Repository '" + repositoryName + "' via JNDI, context=" + jndiContext, t);
} finally {
Thread.currentThread().setContextClassLoader(old);
}
@@ -96,18 +98,19 @@
log.info("Repository name does not start with '" + RMI_PREFIX + "', not trying RMI");
} else {
try {
+ tried += "RMI ";
log.debug("Trying to acquire Repository '" + repositoryName + "' via RMI");
ClientRepositoryFactory crf = new ClientRepositoryFactory();
result = crf.getRepository(repositoryName);
log.info("Acquired Repository '" + repositoryName + "' via RMI");
} catch (Throwable t) {
- log.debug("Unable to acquire Repository '" + repositoryName + "' via RMI", t);
+ log.info("Unable to acquire Repository '" + repositoryName + "' via RMI", t);
}
}
}
if(result == null) {
- log.info("Unable to acquire Repository '" + repositoryName + "'");
+ log.info("Unable to acquire Repository '" + repositoryName + "', tried " + tried);
}
return result;