-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Springboot高版本启动报错。需增加配置信息 #452
Comments
这个未必是nacos的问题。如果是,还是要解决以下的 |
不是nacos的问题,我不配置nacos也会报这个错误。 |
不一定是版本的问题,我的问题是定义了一个@configuration的类,然后在里面定义了一个@bean,名字叫MyGlobalInterceptor,我发现原来是我在MyGlobalInterceptor上也写了@configuration,就会报这个错误 |
这个是SpringBoot版本的问题。 问题出在sb2.1.*中
feignClient如果使用同一个server-id注册多次也会出现类似的情况,官方推荐的做法是手动构建feignClient |
修正下,是这个:DefaultListableBeanFactory
private boolean allowBeanDefinitionOverriding; // 默认是false 而在 在 /** Whether to allow re-registration of a different definition with the same name. */
private boolean allowBeanDefinitionOverriding = true; |
关键是加上了这个配置还是提示这个错误,没有生效。 |
环境:jdk1.8+ spring boot 2.1.1.RELEASE + Spring boot starter web 2.0.4.RELEASE, nacos 0.2.0-RC1
错误: Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
解决方案:需要增加如下配置,即可解决此问题。如有问题请联系wx:878799579.
The text was updated successfully, but these errors were encountered: