开发者社区 > 云原生 > 正文

spring.cloud.sentinel.datasource.ds0.nacos.namespa

漏洞 如下:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ds0-sentinel-nacos-datasource': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'namespace' of bean class [org.springframework.cloud.alibaba.sentinel.datasource.factorybean.NacosDataSourceFactoryBean]: Bean property 'namespace' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1634) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1349) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:572) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.cloud.alibaba.sentinel.custom.SentinelDataSourceHandler.registerBean(SentinelDataSourceHandler.java:258) ~[spring-cloud-alibaba-sentinel-0.2.1.RELEASE.jar:0.2.1.RELEASE] at org.springframework.cloud.alibaba.sentinel.custom.SentinelDataSourceHandler.lambda$buildDataSource$0(SentinelDataSourceHandler.java:116) ~[spring-cloud-alibaba-sentinel-0.2.1.RELEASE.jar:0.2.1.RELEASE] at java.util.TreeMap.forEach(TreeMap.java:1005) ~[na:1.8.0_161] at org.springframework.cloud.alibaba.sentinel.custom.SentinelDataSourceHandler.buildDataSource(SentinelDataSourceHandler.java:104) ~[spring-cloud-alibaba-sentinel-0.2.1.RELEASE.jar:0.2.1.RELEASE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161] at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:261) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:180) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:142) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:400) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:354) ~[spring-context-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:97) ~[spring-boot-2.0.6.RELEASE.jar:2.0.6.RELEASE] at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:72) ~[spring-boot-2.0.6.RELEASE.jar:2.0.6.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-2.0.6.RELEASE.jar:2.0.6.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1242) [spring-boot-2.0.6.RELEASE.jar:2.0.6.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1230) [spring-boot-2.0.6.RELEASE.jar:2.0.6.RELEASE] at com.netease.chaser.services.demo.ServiceDemoApplication.main(ServiceDemoApplication.java:14) [classes/:na] Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'namespace' of bean class [org.springframework.cloud.alibaba.sentinel.datasource.factorybean.NacosDataSourceFactoryBean]: Bean property 'namespace' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? at org.springframework.beans.BeanWrapperImpl.createNotWritablePropertyException(BeanWrapperImpl.java:243) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.beans.AbstractNestablePropertyAccessor.processLocalProperty(AbstractNestablePropertyAccessor.java:426) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:278) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:266) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:97) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:77) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1630) ~[spring-beans-5.0.10.RELEASE.jar:5.0.10.RELEASE] ... 29 common frames omitted

spring-cloud-starter-alibaba-sentinel: 0.2.1 sentinel-datasource-nacos: 1.4.2

原提问者GitHub用户ShZhengqin

展开
收起
白夜行fighting 2023-06-11 10:41:15 87 0
1 条回答
写回答
取消 提交回答
  • 0.2.1.RELEASE版本不支持带有Nacos DataSource的命名空间。它将在下一个版本中得到支持,并在2019年已经发布。https://github.com/spring-cloud-incubator/spring-cloud-alibaba/blob/master/spring-cloud-alibaba-sentinel-datasource/src/main/java/org/springframework/cloud/alibaba/sentinel/datasource/factorybean/NacosDataSourceFactoryBean.java

    原回答者GitHub用户fangjian0423

    2023-06-11 11:31:14
    赞同 展开评论 打赏
问答分类:
问答地址:

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载