面试异常处理手册

springMVC的问题

1.出现的异常实现类动态代理的出错了

***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'attachCacheService' could not be injected as a 'com.abc.service.AttachCacheService' because it is a JDK dynamic proxy that implements:


Action:

Consider injecting the bean as one of its interfaces or forcing the use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableCaching.


Process finished with ex 类it code 1

解决这个问题的思路首先想到的是注解是否没加入。
如果注解已经添加了是否写法上没有按照传统定义的方式,没有定义接口及实现,而是直接定义了实现类
解决方案:
如果出现的原因是没有按照传统方式进行定义,解决的方式有:
①在启动类上加上@EnableTransactionManagement(proxyTargetClass = true)
②在配置类配置spring.aop.proxy-target-class=true
③按照传统方式定义接口及其实现类

2.413的问题

一般就是文件过大,请求体过大,nginx不支持,去设置nginx的上传大小

3.403问题,路径写错了,跨域问题,方法代码没有生效
4.spring的循环依赖问题

问题报错:‘allowEagerInit’ flag turned off
解决思路:@Lazy注解加载@Autowired上,双方都需要加
这一块具体的解决思路还是不太清楚,后续在进行研究吧

	@Autowired
    @Lazy
    private FlawService flawService;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值