修复Configure的telnetPort 和httpPort 在BinderUtils.inject 反射设置异常的问题#2390
Open
zhaojinyu wants to merge 1 commit intoalibaba:masterfrom
Open
修复Configure的telnetPort 和httpPort 在BinderUtils.inject 反射设置异常的问题#2390zhaojinyu wants to merge 1 commit intoalibaba:masterfrom
zhaojinyu wants to merge 1 commit intoalibaba:masterfrom
Conversation
3e980a6 to
3c1e008
Compare
Collaborator
|
更好的办法是让注入的代码本身支持类型转换,应该是少了一些 convertor 类。 暂时可以在配置里用 字符串的方式注入。 |
Author
|
被设置的值类型是integer,set方法的入参是int,在getProperty 时判断类型的时候抛出了异常,starter里设置arthas.httpPort设置成什么都会报错,这个是稳定复现的异常,会导致服务无法启动。增加Convertor转换类我觉得没必要搞那么复杂,其实只要改成相同类型就可以,或者优化getProperty的逻辑对基础类型Int long double等这种进行一下特殊处理。 望尽快修复~ |
Author
被设置的值类型是integer,set方法的入参是int,在getProperty 时判断类型的时候抛出了异常,starter里设置arthas.httpPort设置成什么都会报错,这个是稳定复现的异常,会导致服务无法启动。增加Convertor转换类我觉得没必要搞那么复杂,其实只要改成相同类型就可以,或者优化getProperty的逻辑对基础类型Int long double等这种进行一下特殊处理。 望尽快修复~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
arthas-spring-boot-starter 在设置httpPort或者telnetPort是会报异常:
Caused by: java.lang.IllegalArgumentException: Cannot convert value [8564] from source type [Integer] to target type [int]
at com.taobao.arthas.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:97)
at com.taobao.arthas.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:62)
at com.taobao.arthas.core.env.ArthasEnvironment.getProperty(ArthasEnvironment.java:101)
at com.taobao.arthas.core.config.BinderUtils.inject(BinderUtils.java:53)
... 34 common frames omitted
在BinderUtils.inject 设置值的时候调用PropertySourcesPropertyResolver.getProperty 比较int和integer的时候验证不过抛出异常,Configure 的set方法入参需要修改成Integer