Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataSourceBeanFactoryPostProcessor抛出异常 #80

Closed
rayzeng opened this issue Oct 12, 2018 · 5 comments
Closed

DataSourceBeanFactoryPostProcessor抛出异常 #80

rayzeng opened this issue Oct 12, 2018 · 5 comments
Labels
bug Something isn't working question Further information is requested
Milestone

Comments

@rayzeng
Copy link

rayzeng commented Oct 12, 2018

Describe the bug

升级sofa-boot 2.5.0后,启动失败
java.lang.ClassCastException: java.lang.String cannot be cast to org.springframework.beans.factory.config.TypedStringValue
at com.alipay.sofa.tracer.boot.datasource.processor.DataSourceBeanFactoryPostProcessor.createDataSourceProxy(DataSourceBeanFactoryPostProcessor.java:123) ~[tracer-sofa-boot-starter-2.2.0.jar:2.2.0]
at com.alipay.sofa.tracer.boot.datasource.processor.DataSourceBeanFactoryPostProcessor.postProcessBeanFactory(DataSourceBeanFactoryPostProcessor.java:63) ~[tracer-sofa-boot-starter-2.2.0.jar:2.2.0]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:283) ~[spring-context-4.3.19.RELEASE.jar:4.3.19.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:178) ~[spring-context-4.3.19.RELEASE.jar:4.3.19.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687) ~[spring-context-4.3.19.RELEASE.jar:4.3.19.RELEASE]

url = jdbc:mysql://1.1.1.1:3306/xxx?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull

  • SOFATracer version: 2.2.0
  • JVM version (e.g. java -version):1.8
@khotyn
Copy link
Member

khotyn commented Oct 12, 2018

@rayzeng 能把你的相关的 Bean 的配置贴一下吗?

@QilongZhang QilongZhang added the question Further information is requested label Oct 12, 2018
@rayzeng
Copy link
Author

rayzeng commented Oct 12, 2018

是通过BeanDefinitionBuilder.addPropertyValue从配置中心读取配置初始化的,建议加个类型判断,是TypedStringValue还是String,以兼容这种场景

@khotyn
Copy link
Member

khotyn commented Oct 12, 2018

@QilongZhang 请帮忙跟进下这个 issue~

@QilongZhang
Copy link
Contributor

是通过BeanDefinitionBuilder.addPropertyValue从配置中心读取配置初始化的,建议加个类型判断,是TypedStringValue还是String,以兼容这种场景

抱歉,手动构建BeanDefinition这种用法没有测试到。另外能否写一个简单的复现demo,我看下是否还有其他问题。

@QilongZhang QilongZhang added the bug Something isn't working label Oct 15, 2018
@QilongZhang QilongZhang added this to the 2.2.1 milestone Oct 15, 2018
QilongZhang added a commit to QilongZhang/sofa-tracer that referenced this issue Oct 15, 2018
QilongZhang added a commit to QilongZhang/sofa-tracer that referenced this issue Oct 15, 2018
@QilongZhang
Copy link
Contributor

@rayzeng 已在 PR 修复。

@rayzeng rayzeng closed this as completed Oct 15, 2018
guanchao-yang pushed a commit that referenced this issue Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants