zoukankan      html  css  js  c++  java
  • (黑马十次方项目day04)An attempt was made to call a method that does not exist. The attempt was made from the following location:

    ***************************
    APPLICATION FAILED TO START
    ***************************
    
    Description:
    
    An attempt was made to call a method that does not exist. The attempt was made from the following location:
    
        org.springframework.data.elasticsearch.client.TransportClientFactoryBean.settings(TransportClientFactoryBean.java:106)
    
    The following method did not exist:
    
        org.elasticsearch.common.settings.Settings$Builder.put(Ljava/util/Dictionary;)Lorg/elasticsearch/common/settings/Settings$Builder;
    
    The method's class, org.elasticsearch.common.settings.Settings$Builder, is available from the following locations:
    
        jar:file:/D:/apache-maven-3.6.1/MavenRepo/org/elasticsearch/elasticsearch/6.4.3/elasticsearch-6.4.3.jar!/org/elasticsearch/common/settings/Settings$Builder.class
    
    It was loaded from the following location:
    
        file:/D:/apache-maven-3.6.1/MavenRepo/org/elasticsearch/elasticsearch/6.4.3/elasticsearch-6.4.3.jar
    
    
    Action:
    
    Correct the classpath of your application so that it contains a single, compatible version of org.elasticsearch.common.settings.Settings$Builder
    
    
    进程已结束,退出代码 1
    <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-elasticsearch</artifactId>
            <version>3.0.9.RELEASE</version>
    </dependency>
    spring-data-elasticsearch版本3.0.6报错

    spring-data-elasticsearch版本3.0.9报错
    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'articleSearchService': Unsatisfied dependency expressed 
    through field 'articleSearchDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'articleSearchDao': Cannot
    resolve reference to bean 'elasticsearchTemplate' while setting bean property 'elasticsearchOperations'; nested exception is
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'elasticsearchTemplate' defined in class
    path resource [org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfiguration.class]: Unsatisfied dependency expressed through method
    'elasticsearchTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'elasticsearchClient'
    defined in class path resource [org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfiguration.class]: Bean instantiation via factory method
    failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.elasticsearch.client.transport.TransportClient]: Factory
    method 'elasticsearchClient' threw exception;

    换成  spring-data-elasticsearch版本3.1.10 即可



  • 相关阅读:
    Request
    HTTP
    mysql递归查询函数
    redis 6.0.9配置文件详解
    java对数据进行加密、解密
    java Base64编码、解码
    nginx基础使用
    linux指令笔记
    Spring 常用注解粗陋看法
    docker 已有容器修改容器配置
  • 原文地址:https://www.cnblogs.com/beiweixiaohuo/p/12939528.html
Copyright © 2011-2022 走看看