使用EnableAspectJAutoProxy后项目启动失败
时间: 2024-04-04 11:07:52 浏览: 80
使用@EnableAspectJAutoProxy注解后,项目启动失败的原因可能是因为缺少了exposeProxy属性的配置。这个属性需要设置为true,以将当前代理对象暴露出来。可以在@EnableAspectJAutoProxy注解中添加exposeProxy=true的配置,如下所示:
@EnableAspectJAutoProxy(proxyTargetClass=true, exposeProxy=true)
这样设置之后,启动类中的代理对象将会被正确地暴露出来,解决了启动失败的问题。引用<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [解决Aspcet切面类无法启动/启动无效](https://blog.csdn.net/qq_16488911/article/details/103397857)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [Spring 配置#EnableAsync启动报错_为什么Spring老是失效呢?](https://blog.csdn.net/weixin_39864101/article/details/110142858)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文