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

nacos-springboot 2.1.0 #5

Closed
liaozan opened this issue Nov 26, 2018 · 2 comments
Closed

nacos-springboot 2.1.0 #5

liaozan opened this issue Nov 26, 2018 · 2 comments

Comments

@liaozan
Copy link

liaozan commented Nov 26, 2018

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启动失败,抛出异常
image
image

@fangjian0423
Copy link
Collaborator

Hi @liaozan .

You can try again using 0.2.1 version.

@liaozan
Copy link
Author

liaozan commented Dec 27, 2018

@fangjian0423 thx

@liaozan liaozan closed this as completed Dec 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants