zoukankan      html  css  js  c++  java
  • availableProcessors is already set to [8], rejecting [8]

    错误详细信息:

    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]

    关键信息如下:

    Caused by: java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8]

    通过关键字搜索,找到了解决办法,原因是因为SpringBoot的netty和elasticsearch的netty相关jar冲突

    只需在启动类加入如下代码即可解决(注意,这段代码要放在SpringApplication.run(Application.class, args)之前才行,否则不会生效):

    System.setProperty("es.set.netty.runtime.available.processors", "false");
  • 相关阅读:
    分布式系统学习一-概念篇
    JAVA多线程学习九-原子性操作类的应用
    JAVA多线程学习八-多个线程之间共享数据的方式
    JAVA多线程学习七-线程池
    vue 工作随笔
    智能云课堂整理
    mysql
    模板引挚 jade ejs
    node实战小例子
    昭山欢node资料学习笔记
  • 原文地址:https://www.cnblogs.com/youcong/p/12846828.html
Copyright © 2011-2022 走看看