当我把 “@Transactional(readOnly=false)
” 标注在我的服务类,我得到以下错误事务注释错误
说明:
The bean 'studentService' could not be injected as a '
com.student.service.StudentServiceImpl
' because it is a JDK dynamic proxy that implements: com.student.service.StudentService
示例代码:
@Service("studentService")
@Transactional(readOnly=false)
public class StudentServiceImpl implements StudentService {
}
public interface StudentService {
}
操作:
考虑将bean注入其中一个接口或强制使用CGLib-通过在@EnableAsync
和/或@EnableCaching
上设置proxyTargetClass=true
来实现基于代理的代理。
进程退出代码为1
是什么原因造成完了?
如果您尝试使用JRE构建项目,那么您可以将其更改为JDK吗?你的类路径中是否有所有与方面相关的jar? – Nimesh
这是我的错误,我已经自动布线了Interface的实现类。 – syv
你可以用这个答案回答你自己的问题,因为我遇到了同样的事情,这帮助我解决了这个问题。谢谢! – emilyk