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 即可



  • 相关阅读:
    Eclipse+EPIC+PadWalker
    Commit message 和 Change log 编写指南
    把perl脚本编译成exe
    Qt使用中碰到的问题
    Python——函数 7、位置参数与默认参数之间的关系
    Python——函数 6、默认参数
    Python——函数 5、位置参数与关键字参数
    Python——函数 4、形参的应用
    Python——函数 3、实参与形参
    Python——函数 2、返回值
  • 原文地址:https://www.cnblogs.com/beiweixiaohuo/p/12939528.html
Copyright © 2011-2022 走看看