當我把 「@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