-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
项目启动报WARN #2328
Comments
apollo在注册PropertySourcesPlaceholderConfigurer时会检查是否已经存在这个bean的,如果不存在才会添加。 建议在报warning的地方加个断点看下另外一个bean是谁加进来的。 |
我跑了SpringBootSampleApplication这个sample,貌似没能复现这个问题? |
异常:2019-06-27 10:27:31.108 INFO 7255 --- [ main] com.example.demo.DemoApplication : No active profile set, falling back to default profiles: default SpringBoot使用https://start.spring.io/ 创建最简化项目demo地址https://github.com/liuzedong/apollo-demo |
确实能重现这个问题,看了一下,如果在DemoApplication上打上注解 @SpringBootApplication
@EnableApolloConfig
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
} |
public static boolean registerBeanDefinitionIfNotExists(BeanDefinitionRegistry registry, String beanName, Class<?> beanClass, Map<String, Object> extraPropertyValues) {
// 这里是否能通过beanClass判断?
if (registry.containsBeanDefinition(beanName)) {
return false;
} else {
String[] candidates = registry.getBeanDefinitionNames();
String[] arr$ = candidates;
int len$ = candidates.length;
for(int i$ = 0; i$ < len$; ++i$) {
String candidate = arr$[i$];
BeanDefinition beanDefinition = registry.getBeanDefinition(candidate);
if (Objects.equals(beanDefinition.getBeanClassName(), beanClass.getName())) {
return false;
}
}
BeanDefinition beanDefinition = BeanDefinitionBuilder.genericBeanDefinition(beanClass).getBeanDefinition();
if (extraPropertyValues != null) {
Iterator i$ = extraPropertyValues.entrySet().iterator();
while(i$.hasNext()) {
Entry<String, Object> entry = (Entry)i$.next();
beanDefinition.getPropertyValues().add((String)entry.getKey(), entry.getValue());
}
}
registry.registerBeanDefinition(beanName, beanDefinition);
return true;
}
}
|
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in 14 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 14 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions. |
case: beanDefinition of the bean defined in Configuration annotated class in this case, the `beanDefinition.getBeanClassName()` and `beanClass.getName()` is not match
`beanFactory.isTypeMatch` may lead to the initialization of FactoryBean, dubbo consumer is a ReferenceBean which implements FactoryBean. related to apolloconfig#2328 apolloconfig#3865
`beanFactory.isTypeMatch` may lead to the initialization of FactoryBean, dubbo consumer is a ReferenceBean which implements FactoryBean. related to apolloconfig#2328 apolloconfig#3865
`beanFactory.isTypeMatch` may lead to the initialization of FactoryBean, dubbo consumer is a ReferenceBean which implements FactoryBean. support spring 3 related to apolloconfig#2328 apolloconfig#3865 apolloconfig#4161 apolloconfig#4164
`beanFactory.isTypeMatch` may lead to the initialization of FactoryBean, dubbo consumer is a ReferenceBean which implements FactoryBean. support spring 3 related to apolloconfig#2328 apolloconfig#3865 apolloconfig#4161 apolloconfig#4164
`beanFactory.isTypeMatch` may lead to the initialization of FactoryBean, dubbo consumer is a ReferenceBean which implements FactoryBean. support spring 3 related to apolloconfig#2328 apolloconfig#3865 apolloconfig#4161 apolloconfig#4164
日志
2019-06-12 12:04:59.670|/|WARN |main|o.s.b.c.p.PropertySourcesDeducer|Multiple PropertySourcesPlaceholderConfigurer beans registered [propertySourcesPlaceholderConfigurer, org.springframework.context.support.PropertySourcesPlaceholderConfigurer], falling back to Environment
Apollo Client => ConfigPropertySourcesProcessor
Spring boot => org.springframework.boot.context.properties.PropertySourcesDeducer
这个能修复下吗? 项目使用 sentry, 每次项目启动 都收到 邮件提醒。
The text was updated successfully, but these errors were encountered: