初次学习solr的时候不能把dist文件夹所有的包都导入工程中,这样会有slf4j异常,这是因为slf4j版本冲突导致的。一个一个jar的导入的话,中间还是有许多异常出在哪个jar包中不清楚,所以我把我遇到的异常整理了一下。
异常一:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/NoHttpResponseException
Caused by: java.lang.ClassNotFoundException:org.apache.http.NoHttpResponseException
缺少httpcore-4.2.5.jar
异常二:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpRequestBase
Caused by: java.lang.ClassNotFoundException: org.apache.http.client.methods.HttpRequestBase
缺少httpclient-4.2.6.jar
异常三:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/entity/mime/content/ContentBody
Caused by: java.lang.ClassNotFoundException:org.apache.http.entity.mime.content.ContentBody
缺少httpmime-4.2.6.jar
异常四:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
缺少commons-logging.jar
异常五:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
缺少noggit-0.5.jar
下载地址:http://www.java2s.com/Code/Jar/n/Downloadnoggit05jar.htm
如果还有其他的异常,可以参考文章:
http://blog.sina.com.cn/s/blog_5ddc071f0101mtpf.html
http://www.myexception.cn/web/1475146.html