springboot 启动的时候报错 Error creating bean with name 'solrClient'

springboot 启动的时候报错:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'solrClient' defined in class path resource [org/springframework/boot/autoconfigure/solr/SolrAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.solr.client.solrj.SolrClient]: Factory method 'solrClient' threw exception; nested exception is java.lang.NoSuchMethodError: org.apache.solr.client.solrj.impl.HttpClientUtil.createClient(Lorg/apache/solr/common/params/SolrParams;)Lorg/apache/http/impl/client/CloseableHttpClient;

在spring boot 中添加  (exclude=SolrAutoConfiguration.class)

package com;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.support.SpringBootServletInitializer; @SpringBootApplication(exclude=SolrAutoConfiguration.class)
public class Application extends SpringBootServletInitializer { public static void main(String[] args) {
SpringApplication.run(Application.class, args);
} }
上一篇:Spring Boot2.1.7启动zipkin-server报错:Error creating bean with name 'armeriaServer' defined in class path


下一篇:exit(-1)或者return(-1)为什么shell得到的退出码是255?