Error creating bean with name ‘mailNotifier‘ defined in class path resource [de/codecentric/boot/adm

 springboot项目,原先有redisson,引入邮箱包后启动报错

Error creating bean with name 'mailNotifier' defined in class path resource [de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfiguration$MailNotifierConfiguration.class]

控制台有大量的redisson连接报错,以为是redis报错

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mailNotifier' defined in class path resource [de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfiguration$MailNotifierConfiguration.class]: Unsatisfied dependency expressed through method 'mailNotifier' parameter 1; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'de.codecentric.boot.admin.server.domain.entities.InstanceRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
java.io.IOException: 远程主机强迫关闭了一个现有的连接。

.... redis连接错误

后来找到原因,在创建名为 mailNotifier 的Bean时出现了问题。这个Bean是由Spring Boot Admin的自动配置类 AdminServerNotifierAutoConfiguration$MailNotifierConfiguration 定义的。
使用排除规则,如果确定不需要邮件通知功能,可以通过排除自动配置来避免创建这个Bean

@SpringBootApplication(exclude = {AdminServerNotifierAutoConfiguration.class})
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

至此,控制台启动正常。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Error creating bean with name 'dataSource' defined in class path resource [org/apache/ - 这个错误是在初始化bean时出现的,具体的错误信息是"nested..."。根据引用中提到的异常信息,这个错误可能是由于初始化dataSource bean时出现了问题。根据引用中提到的解决办法,可以尝试在项目的pom.xml文件中添加相应的配置,去解决找不到UserMapper.xml文件的问题。另外,引用中提到的可能是由于jar包冲突导致的问题,可以尝试删除一些冲突的jar包来解决这个问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [struts2驱动包](https://download.csdn.net/download/zengzitao823/2480227)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [error creating bean with name sqlSessionFactory defined in class path resource spring/spring-mvc](https://blog.csdn.net/developerFBI/article/details/106631130)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [Error creating bean with name ‘dataSource‘ defined in class path resource [applicationContext.xml]](https://blog.csdn.net/qq_44965393/article/details/115819264)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值