報(bào)java.lang.ClassCastException: springAOP.ServiceGongNeng cannot be cast to springAOP.ServiceInterfaceFunction,求解答
目錄結(jié)構(gòu):
接口及其實(shí)現(xiàn)類代碼:
public interface ServiceInterfaceFunction {
public void print();
}
public class ServiceFunction implements ServiceInterfaceFunction {
@Override
public void print() {
System.out.println("邏輯功能接口實(shí)現(xiàn)類的方法執(zhí)行了");
}
}
邏輯方法代碼:
public class ServiceGongNeng {
public void say(){
System.out.println("哈哈哈哈哈哈哈");
}
}
切面類的代碼:
public class AspectFunction {
public void beforeAspect(String name,int time){
System.out.println("名字為"+name);
System.out.println(time+"次");
System.out.println("切面前置通知功能實(shí)現(xiàn)了");
}
}
配置文件:
2019-11-22
修改為com.imooc.aop.schema.advice.*Biz? 因?yàn)閠ypes-matching是到的類 不能到方法
2019-05-27
新手回答,是不是有一個(gè)文件沒有保存