![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot问题总结
点击抽奖
努力学习.不断提升自己
展开
-
Spring获取bean工具类
Spring获取bean工具类 spring获取bean方法封装. 通用工具类 package com.sample.service.client.serviceclient.util; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAw原创 2021-07-21 16:42:51 · 277 阅读 · 0 评论 -
SmartLifecycle正确姿势
SmartLifecycle正确姿势 场景: 之前项目实现SmartLifecycle接口.默认需要重写start()和stop(),这接口优秀在只要被spring接管的bean,实现并重写这两个方法就能在服务启动或者停止时执行. 旧版本运行代码 public class SomeServiceImpl implements SmartLifecycle { @Override public void start() { log.info("服务启动后,初始化...");原创 2020-09-04 14:29:49 · 450 阅读 · 0 评论 -
springboot启动异常[ The last packet sent successfully to the server was 0 milliseconds ago. ]
异常 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 解决方案: 搜索之后大部分都说是mysql 8小时事件 最后尝试改配置文件的时候发现 根本就是自己粗心,mysql服务根本没启...原创 2018-08-15 11:03:41 · 4914 阅读 · 0 评论