springboot整合es,在打war包后,服务器上运行报错

本文介绍了SpringBoot项目在打包为war文件并部署到服务器上的Tomcat时,由于es设置问题导致的启动错误。问题关键在于war包启动方式与main方法不同,需要在configure方法中设置`es.set.netty.runtime.available.processors`为`false`来避免报错。
摘要由CSDN通过智能技术生成

springboot整合es,在打war包后,服务器上运行报错

前几天准备将应用打war包到服务器上,在tomcat中启动war包时,却报错了,导致项目启动失败,原本是在main方法中进行了System.setProperty(“es.set.netty.runtime.available.processors”, “false”)设置的,却还是一直报错

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.elasticsearch.client.transport.TransportClient]: Factory method 'esClient' threw exception; nested exception is java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:579) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
	... 44 common frames omitted
Caused by: java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
	at io.netty.util.NettyRuntime$Avai
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值