赞
踩
项目启动输出:
Description:
Field pushTokenDao in com.bullyun.rule.core.strategy.AppMsgActionStrategy required a bean of type 'com.manniu.rds.api.PushTokenDao' that could not be found.
Action:
Consider defining a bean of type 'com.manniu.rds.api.PushTokenDao' in your configuration.
但是明明已经定义了这个类型的 bean,为什么还提示这个错误呢?
可能的一种原因是出现了相同名称的 bean了,而且其类型是不同的。使用 @Bean 注解如果不指定名称,那么将使用方法名。下面是注解 @Bean 源代码中的备注说明:
* The name of this bean, or if several names, a primary bean name plus aliases.
* <p>If left unspecified, the name of the bean is the name of the annotated method.
* If specified, the method name is ignored.
* <p>The bean name and aliases may also be configured via the {@link #value}
* attribute if no other attributes are declared.
* @see #value
*/
@AliasFor("value")
String[] name() default {};
解决方法就很简单了,要么指定 bean name ,没么改变方法名。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。