• elasticSearch availableProcessors is already set to [8], rejecting [8]


    使用springboot elasticSearch启动时报

    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiSearchController': Unsatisfied dependency expressed through field 'compRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compRepository': 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; nested exception is java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8]码片

    网上查了一下,是elasticSearch和redis共用netty连接,导致连接冲突了,解决办法就是在application启动类上加下面的代码

      public static void main(String[] args){
    
           //解决netty冲突   
         System.setProperty("es.set.netty.runtime.available.processors", "false");
            SpringApplication.run(Application.class, args);
        }    

    但我这样设置了没反应,还是继续报错,最后是在jvm的参数哪里加了下面的代码

    -Des.set.netty.runtime.available.processors=false

     这样问题就解决了

    转载于:https://blog.csdn.net/qq_41571395/article/details/106616665

  • 相关阅读:
    2020-11-07:已知一个正整数数组,两个数相加等于N并且一定存在,如何找到两个数相乘最小的两个数?
    2020-11-06:go中,谈一下调度器。
    Python2和Python3中urllib库中urlencode的使用注意事项
    python爬虫基础
    python自动抢票
    Movist for Mac 1.4.2 破解版 | Mac上好用的视频播放器有哪些?7 款本地视频播放器实测对比
    前端自动化及优化
    移动端库
    jQuery
    JavaScript
  • 原文地址:https://www.cnblogs.com/it-deepinmind/p/14468846.html
Copyright © 2020-2023  润新知