问题描述
如题,有一个aop项目运行时一直报无法创建bean,根据报错信息可以确定报错位置在bean.xml文件,代码已尝试纠错,但没有效果,目前完全不知道这个错误是什么原因导致的,希望有人可以帮忙解决一下
【因为项目代码较多,且题主不知道什么原因导致报错,故将项目完整放在和彩云以方便排错,链接: https://caiyun.139.com/m/i?0d... 提取码:r77z 】
运行环境
interllij开发版2021.3
jdk1.8
spring 5
该项目为基于maven的spring项目
问题配置文件
【因为项目代码较多,且题主不知道什么原因导致报错,故将项目完整放在和彩云以方便排错,链接: https://caiyun.139.com/m/i?0d... 提取码:r77z】
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop.xsd">
<bean id="ho" class="HouseOwner"/>
<bean id="ls" class="LogStart"/>
<aop:config>
<!--切入点:公共业务需要切入进哪些方法(或类)上-->
<aop:pointcut id="pointcut" expression="execution(* HouseOwner.sell())"/>
<!--关注点:我要用哪些公共的业务【关注点-连接-写入点】-->
<aop:advisor advice-ref="ls" pointcut-ref="pointcut"/>
</aop:config>
</beans>
pom.xml加入aop的依赖,
ps:学会发问题,把你的异常信息发上来,而不是一上来就贴这些东西