本文共 192 字,大约阅读时间需要 1 分钟。
解决思路:
1.先查看启动类是否加上 @EnableAsync 注解,如果没有,就加上该注解再重新启动
2.查看异步方法的调用方式是否正确 @Async 3.@Async的调用涉及到动态代理,如果直接将需要异步操作的方法写到业务类中,业务类直接调用,则执行逻辑不会走到代理类,异步就会失效,所以异步方法单独拿出来封装到一个类中,再将这个类注入到业务类中,业务类通过这个类来调用异步方法转载地址:http://pkowi.baihongyu.com/