spring boot aop拦截日志问题 5C

写了一个aspect用于拦截日志并记录到数据库,注入了一个LogSvc用于写日志到数据库,只要在logsvc
的writeLog()方法加了@Transaction注解,启动就会报错“the bean 'logSvc' could not be injected as a 'com.erong.acct.batch.service.generalsvc.LogSvc' 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 @EnableC
aching.”

在bootstrap.yml开启“ proxy-target-class: true”也没用,求大神指导!!!

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问