许可优化
许可优化
产品
产品
解决方案
解决方案
服务支持
服务支持
关于
关于
软件库
当前位置:服务支持 >  软件文章 >  IllegalArgumentException: bad property value. property name 'execution.isolation.strategy异常解决办法:Java IllegalArgumentException异常解决:execution.isolation.strategy属性错误

IllegalArgumentException: bad property value. property name 'execution.isolation.strategy异常解决办法:Java IllegalArgumentException异常解决:execution.isolation.strategy属性错误

阅读数 4
点赞 0
article_banner

java.lang.IllegalArgumentException: bad property value. property name 'execution.isolation.strategy'. Expected correct enum value, one of the [[THREAD, SEMAPHORE]] , actual = thread异常 解决 办法

一.异常问题

我在SpringCloud项目中,利用 feign  进行远程调用时,结合Hystrix进行服务熔断降级功能的实现时,对Tomcat线程池进行调优配置时,出现如下异常信息:

通过查看 控制台 日志信息,发现如下异常信息:

java.lang.IllegalArgumentException: bad property value. property name 'execution.isolation.strategy'. Expected correct enum value, one of the [[THREAD, SEMAPHORE]] , actual = thread`     `at com.netflix.hystrix.contrib.javanica.conf.HystrixPropertiesManager.createBadEnumError(HystrixPropertiesManager.java:409) ~[hystrix-javanica-1.5.18.jar:1.5.18]`     at com.netflix.hystrix.contrib.javanica.conf.HystrixPropertiesManager.toEnum(HystrixPropertiesManager.java:392) ~[hystrix-javanica-1.5.18.jar:1.5.18]`

通过分析得知,是因为我的一个属性值错误!

也就是execution.isolation.strategy的属性值有问题。

execution.isolation.strategy的属性值有两个,分别为:THREAD 和 SEMAPHORE,而且必须是大写!

结果我代码中是小写的,所以出现以上问题。

二.解决办法

把属性值改为大写即可,如下图所示。

代码如下:

@GetMapping("/hystrix/show")`  `@HystrixCommand(fallbackMethod = "myFallbackMethod",commandProperties = {`      `@HystrixProperty(name="execution.isolation.strategy",value = "THREAD"),`      `@HystrixProperty(name="execution.isolation.thread.timeoutInMilliseconds",value = "3000"),`      `@HystrixProperty(name="circuitBreaker.enabled",value = "true"),`      `@HystrixProperty(name="circuitBreaker.requestVolumeThreshold",value = "3")`  `})`  `*public* String showRemotePort() {` ​    `*return* searchClient.callRemotePort();`  `}

免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删

相关文章
技术文档
QR Code
微信扫一扫,欢迎咨询~
customer

online

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 board-phone 155-2731-8020
close1
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

姓名不为空

姓名不为空
手机不正确

手机不正确

手机不正确
公司不为空

公司不为空

公司不为空