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:04:49 UTC
svn commit: r1476369 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/core/
solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
Author: sarowe
Date: Fri Apr 26 20:04:49 2013
New Revision: 1476369
URL: http://svn.apache.org/r1476369
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/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/solr/ (props changed)
lucene/dev/branches/branch_4x/solr/core/ (props changed)
lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java?rev=1476369&r1=1476368&r2=1476369&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java Fri Apr 26 20:04:49 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
{