一尘不染

添加任何自定义实体后出现jHispter Elasticsearch问题

elasticsearch

org.springframework.beans.factory.UnsatisfiedDependencyException: 
  Error creating bean with name 'countryServiceImpl' defined in file [E:\tms-ws\TransportManagement\target\classes\com\baltransport\tms\app\v1\service\impl\CountryServiceImpl.class]: 
  Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'countrySearchRepository': Invocation of init method failed; 
  nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.springframework.data.elasticsearch.repository.support.NumberKeyedRepository]: 
    Constructor threw exception; nested exception is org.springframework.data.elasticsearch.ElasticsearchException: Failed to build mapping for country:country
    at org.springframework. ...

添加任何自定义实体后,出现此异常jHispter Elasticsearch问题。

第一次使用时效果很好(使用默认的jdl)


阅读 409

收藏
2020-06-22

共1个答案

一尘不染

您可以尝试:

  1. 删除数据库并重新创建。
  2. 导入您的jdl,其中包含新闻更改,也许是新实体。
  3. 在docker中运行elasticsearch。(在您的项目中找到此文件.yml),并检查其是否正确运行(localhost:9200)
  4. 运行您的应用程序(整体或微服务)

问候

2020-06-22