在报错的 method 上加 @Transactional 解决问题。 参考: https://stackoverflow.com/questions/32269192/spring-no-entitymanager-with-actual-transaction-available-for-current-thread https://docs.spring.io/spring/docs/current/spring-framework-reference/data-access.html#orm