相关疑难解决方法(0)

交易注释错误

当我@Transactional(readOnly=false)在我的Service类中添加" "注释时,我收到以下错误

描述:

bean"studentService"无法作为' com.student.service.StudentServiceImpl' 注入,因为它是一个实现的JDK动态代理:com.student.service.StudentService

示例代码:

@Service("studentService")
@Transactional(readOnly=false)
public class StudentServiceImpl implements StudentService {

}

public interface StudentService {

}
Run Code Online (Sandbox Code Playgroud)

行动:

考虑将bean注入其接口之一或通过设置proxyTargetClass=trueon @EnableAsync和/或强制使用基于CGLib的代理@EnableCaching.

进程以退出代码1结束

是什么造成的?

java dependency-injection spring-boot

14
推荐指数
2
解决办法
2万
查看次数

标签 统计

dependency-injection ×1

java ×1

spring-boot ×1