spring boot 启动报错
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-05-30 10:54:20 3450 ERROR o.s.b.d.LoggingFailureAnalysisReporter -
***************************
APPLICATION FAILED TO START
***************************
Description:
The bean 'entityManagerFactory' could not be injected as a 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean' because it is a JDK dynamic proxy that implements:
org.springframework.context.ResourceLoaderAware
org.springframework.context.weaving.LoadTimeWeaverAware
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
解决方法除了在配置中添加@EnableTransactionManagement和@EnableAsync
使用到
@Resource
LocalContainerEntityManagerFactoryBean
需要改为
@Autowired
LocalContainerEntityManagerFactoryBean
还有另外一种可能是
启动类位置不在同级包下