亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

報java.lang.ClassCastException: springAOP.ServiceGongNeng cannot be cast to springAOP.ServiceInterfaceFunction,求解答

目錄結構:

https://img1.sycdn.imooc.com//5ce7ad550001ecfa03640210.jpg

接口及其實現類代碼:

public interface ServiceInterfaceFunction {

public void print();

}

public class ServiceFunction implements ServiceInterfaceFunction {

@Override

public void print() {

System.out.println("邏輯功能接口實現類的方法執行了");

}

}

邏輯方法代碼:

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("切面前置通知功能實現了");

}

}

配置文件:
https://img1.sycdn.imooc.com//5ce7ae2d00019ad514230857.jpg

正在回答

2 回答

修改為com.imooc.aop.schema.advice.*Biz? 因為types-matching是到的類 不能到方法

1 回復 有任何疑惑可以回復我~

新手回答,是不是有一個文件沒有保存

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
Spring入門篇
  • 參與學習       268802    人
  • 解答問題       1026    個

為您帶來IOC和AOP的基本概念及用法,為后續高級課程學習打下基礎

進入課程

報java.lang.ClassCastException: springAOP.ServiceGongNeng cannot be cast to springAOP.ServiceInterfaceFunction,求解答

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號