将SolrJ库添加到Grails 3会导致NoClassDefFoundError错误

时间:2018-09-25 13:33:10

标签: solrj grails3 grails3.2.0

当我将SolrJ添加到Grails 3.2.4中时,并且在创建客户端时,我得到java.lang.NoClassDefFoundError: org/apache/http/impl/conn/PoolingHttpClientConnectionManager

我添加的依赖项: compile group: 'org.apache.solr', name: 'solr-solrj', version: '7.5.0'

堆栈跟踪如下:

Caused by: java.lang.NoClassDefFoundError: org/apache/http/impl/conn/PoolingHttpClientConnectionManager
        at org.apache.solr.client.solrj.impl.HttpClientUtil.createPoolingConnectionManager(HttpClientUtil.java:260)
        at org.apache.solr.client.solrj.impl.HttpClientUtil.createClient(HttpClientUtil.java:255)
        at org.apache.solr.client.solrj.impl.HttpSolrClient.<init>(HttpSolrClient.java:200)
        at org.apache.solr.client.solrj.impl.HttpSolrClient$Builder.build(HttpSolrClient.java:951)
        at (TestController.groovy:40)
        ... 14 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.apache.http.impl.conn.PoolingHttpClientConnectionManager
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 19 common frames omitted

知道为什么会这样吗?

0 个答案:

没有答案