日常BUG一下
统计回顾遇到的BUG
MR_ZhiEr
这个作者很懒,什么都没留下…
展开
-
Spring事务回滚失败
下面是一个回滚事务的案例需求是:转账失败后 转账的事务会回滚,日志事务不会回滚出现的问题是:日志事务开启了@Transactional(propagation = Propagation.REQUIRES_NEW)转账事务开启了@Transactional(rollbackFor = {IOException.class})转账事务中间使用Try catch finally 使出现异常,日志事务能照常运行失败情况是:账单有一个执行了,事务未回滚,日志正常记录转账失败信息失败的原创 2022-01-19 02:13:09 · 970 阅读 · 0 评论 -
Spring容器未更新
报错:java.lang.IllegalStateException: org.springframework.context.annotation.AnnotationConfigApplicationContext@7bd7d6d6 has not been refreshed yet注解容器未更新原因:ApplicationContext ctx = new AnnotationConfigApplicationContext();初始化容器未指定配置文件解决办法:加上配置原创 2022-01-17 18:28:08 · 441 阅读 · 0 评论 -
Spring缺失连接池
错误原因:Caused by: java.lang.IllegalArgumentException: Property 'dataSource' is required缺失dataSource连接池检查方法:可以在JDBC处打一个输出一下连接池,和获取配置文件的属性信息,看一下是否正常@Value("${jdbc.driver}") private String drive; @Value("${jdbc.url}") private String url;原创 2022-01-17 13:17:11 · 454 阅读 · 0 评论 -
Spring通知类(AOP)报错
报错代码:java.lang.IllegalArgumentException: warning no match for this type name: com.xxxx.service [Xlint:invalidAbsoluteTypeName]出错代码:@Pointcut("execution(void com.itheima.service.*(int))")出错原因:AOP匹配路径匹配不到解决办法:...原创 2022-01-17 01:46:22 · 946 阅读 · 0 评论