You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nacos-springboot在启动时会扫描当前应用程序是否注册了PropertySourcesPlaceholderConfigurer,方式是通过com.alibaba.nacos.spring.util.NacosBeanUtils#isBeanDefinitionPresent判断是否存在,在springboot2.1.0之前的版本,启动时都会打印一句日志Overriding user-defined bean definition for bean 'propertySourcesPlaceholderConfigurer' with a framework-generated bean definition,debug发现,在注册PropertySourcesPlaceholderConfigurer时,spring容器beanName为propertySourcesPlaceholderConfigurer的beanDefinition,通过resovleBeanType解析出的beanClass为class org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration,并不符合所需要的beanClass(PropertySourcesPlaceholderConfigurer),所以nacos重复注册了一个PropertySourcesPlaceholderConfigurer,springboot2.1.0之前allowBeanDefinitionOverriding为true,但是在2.1.0中,默认为false,导致nacos启动失败,抛出异常
The text was updated successfully, but these errors were encountered:
nacos-springboot
在启动时会扫描当前应用程序是否注册了PropertySourcesPlaceholderConfigurer
,方式是通过com.alibaba.nacos.spring.util.NacosBeanUtils#isBeanDefinitionPresent
判断是否存在,在springboot2.1.0之前的版本,启动时都会打印一句日志Overriding user-defined bean definition for bean 'propertySourcesPlaceholderConfigurer' with a framework-generated bean definition
,debug发现,在注册PropertySourcesPlaceholderConfigurer时,spring容器beanName为propertySourcesPlaceholderConfigurer
的beanDefinition,通过resovleBeanType解析出的beanClass为class org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
,并不符合所需要的beanClass(PropertySourcesPlaceholderConfigurer
),所以nacos重复注册了一个PropertySourcesPlaceholderConfigurer
,springboot2.1.0之前allowBeanDefinitionOverriding
为true,但是在2.1.0中,默认为false,导致nacos启动失败,抛出异常The text was updated successfully, but these errors were encountered: