You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2013/04/26 22:05:20 UTC

svn commit: r1476372 - in /lucene/dev/branches/lucene_solr_4_3: ./ solr/ solr/core/ solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java

Author: sarowe
Date: Fri Apr 26 20:05:20 2013
New Revision: 1476372

URL: http://svn.apache.org/r1476372
Log:
SOLR-4771: Throw a more specific exception when SLF4J logging jars cannot be found on the classpath. (merged trunk r1476362)

Modified:
    lucene/dev/branches/lucene_solr_4_3/   (props changed)
    lucene/dev/branches/lucene_solr_4_3/solr/   (props changed)
    lucene/dev/branches/lucene_solr_4_3/solr/core/   (props changed)
    lucene/dev/branches/lucene_solr_4_3/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java

Modified: lucene/dev/branches/lucene_solr_4_3/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_3/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java?rev=1476372&r1=1476371&r2=1476372&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_3/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java (original)
+++ lucene/dev/branches/lucene_solr_4_3/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java Fri Apr 26 20:05:20 2013
@@ -48,6 +48,7 @@ import javax.servlet.http.HttpServletRes
 
 import org.apache.commons.io.IOUtils;
 import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrException.ErrorCode;
 import org.apache.solr.common.cloud.Aliases;
 import org.apache.solr.common.cloud.ClusterState;
 import org.apache.solr.common.cloud.Replica;
@@ -87,7 +88,7 @@ import org.slf4j.LoggerFactory;
  */
 public class SolrDispatchFilter implements Filter
 {
-  final Logger log = LoggerFactory.getLogger(SolrDispatchFilter.class);
+  final Logger log;
 
   protected volatile CoreContainer cores;
 
@@ -97,6 +98,19 @@ public class SolrDispatchFilter implemen
   
   private static final Charset UTF8 = Charset.forName("UTF-8");
 
+  public SolrDispatchFilter() {
+    try {
+      log = LoggerFactory.getLogger(SolrDispatchFilter.class);
+    } catch (NoClassDefFoundError e) {
+      throw new SolrException(
+          ErrorCode.SERVER_ERROR,
+          "Could not find necessary SLF4j logging jars. If using Jetty, the SLF4j logging jars need to go in "
+          +"the jetty lib/ext directory. For other containers, the corresponding directory should be used. "
+          +"For more information, see: http://wiki.apache.org/solr/SolrLogging",
+          e);
+    }
+  }
+  
   @Override
   public void init(FilterConfig config) throws ServletException
   {