严重: Exception starting filter SolrRequestFilter
org.apache.solr.common.SolrException: Could not find necessary SLF4j logging jars. If using Jetty, the SLF4j logging jar
s 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
at org.apache.solr.servlet.SolrDispatchFilter.<init>(SolrDispatchFilter.java:104)
......
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.apache.solr.servlet.SolrDispatchFilter.<init>(SolrDispatchFilter.java:102)
... 33 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
... 34 more
2013-8-9 15:38:59 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2013-8-9 15:38:59 org.apache.catalina.core.StandardContext start
严重: Context [/solr] startup failed due to previous errors
很显然,提示我们找不到日志相关的jar包,还提示我们去看solr的相关wiki链接:http://wiki.apache.org/solr/SolrLogging
到该Wiki页面中我们会找到如下几段文字说明:
What changed
These versions do not include any logging jars in the WAR file. They must be provided separately. The Solr example for these versions includes jars (in the jetty lib/ext directory) that set up SLF4J with a binding to the Apache log4j library.
To get the same logging setup in another container (Tomcat for example) as with the example Jetty server, you need to do the following
Copy the jars from solr/example/lib/ext into your container's main lib directory. These jars will set up SLF4J and log4j.
Exactly where this lib directory is highly variable. For a Debian or Ubuntu server using the Tomcat package available from the OS vendor, this is likely to be/usr/share/tomcat6/lib or/usr/share/tomcat7/lib.
Copy the logging config from solr/example/resources/log4j.properties into a location on the classpath. Usually you can use the same location as the jar files above. Edit the configuration file for your preferred log destination.
Optionally, if you did not place log4j.properties on the classpath, set java option-Dlog4j.configuration=file:///path/to/log4j.properties