When I put "@Transactional(readOnly=false)
" annotation in my Service class I get the following error
Description:
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
Sample code:
@Service("studentService")
@Transactional(readOnly=false)
public class StudentServiceImpl implements StudentService {
}
public interface StudentService {
}
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 exit code 1
What is causing this?
See Question&Answers more detail:os