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);
    }

}

 

相关文章:

  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2021-08-19
  • 2022-01-05
  • 2022-02-08
  • 2021-08-05
猜你喜欢
  • 2021-04-02
  • 2022-12-23
  • 2022-12-23
  • 2022-02-28
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案