Open xiaomizhou2 opened 2 years ago
how to solve it
what's this about? that bean is not defined by the plugin... and in any case, allow-bean-definition-overriding is something you can control from your application
just like this issue, if this starter uses with spring cloud feign, then this error will appear https://github.com/ulisesbocchio/jasypt-spring-boot/issues/301
I'm gonna need more information tho.... do you have a test project I can run?
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(Application.class);
springApplication.setAllowBeanDefinitionOverriding(true);
springApplication.run(args);
}
I also encountered this situation.
在bootstrap.yml配置allow-bean-definition-overriding=true的属性不起作用 是有先后顺序的问题吗
why???????
import jasypt-spring-boot-starter will make bootstrap.yml useless. I add config with jasypt.encryptor.bootstrap: false
in bootstrap.yml to solve this problem
@walldong 能排查出这个问题的原因吗?为什么会影响到
@walldong 能排查出这个问题的原因吗?为什么会影响到
Spring Cloud 的 Bootstrap 阶段负责加载 bootstrap.yml 文件,这一阶段会在主应用上下文初始化之前执行。Spring Cloud 在合并 bootstrap 环境变量到主上下文时,只会合并 OriginTrackedMapPropertySource 类型的 PropertySource,而 Jasypt 在处理加密属性时,会将 PropertySource 包装为 EncryptablePropertySourceWrapper,导致 bootstrap.yml 中的加密配置在合并时被忽略。 application.yml 由于加载优先级滞后,所有它的加载就不会受影响
Description:
The bean 'middleoffice-systemservice-fast.FeignClientSpecification' could not be registered. A bean with that name has already been defined and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true