jHispter Elasticsearch issue after adding any custom entity

自闭症网瘾萝莉.ら 提交于 2020-01-15 09:57:35

问题


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. ...

Getting this exception jHispter Elasticsearch issue after adding any custom entity .

It works perfectly fine first time (with default jdl)


回答1:


U can try:

  1. Delete db and create again.
  2. Import your jdl, with the news changes, maybe new entity.
  3. Run elasticsearch in docker. (Find this file .yml in your project) and check if this is run correctly (localhost:9200)
  4. Run your app (monolith or microservices)

Regards




回答2:


you can try to delete the indexes in elasticsearch directly from the url. Supposing you index is called "user" you can do the

DELETE /indexname



来源:https://stackoverflow.com/questions/55058416/jhispter-elasticsearch-issue-after-adding-any-custom-entity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!