記錄一下下:
練習AOP編程時,spring配置的沒有錯,但是一直報這個錯誤:
Error creating bean with name 'empService' defined in class path resource [aop/spring.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/NativeDetector
大概意思就是嵌套異常spring框架中的NativeDetector引用找不到了
多翻排查,最后發(fā)現(xiàn)問題出在pom文件。spring-aop版本過高,spring-expression和spring-aspects都是5.3.3,但是aop是5.3.5。降到5.3.3之后終于不報錯了