今天寫Spring遇到了一個坑爹的問題,那么因為啥原因呢?
錯誤提示我錯誤的加載了Bean
警告: Exception encountered during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.BeanCreationException:
我去看了一下我的切面類:
advice后面應該是ref而不是value,需要的是一個引用而不是String,難怪后面會報錯:
Cannot convert value of type ‘java.lang.String’ to required type ‘org.aopalliance.aop.Advice’ for property ‘advice’: no matching editors or conversion strategy found
真是大意。。
遇到這種錯不是注解寫少了就是寫錯了,亦或是applicationContext.xml中名字寫錯了要么就是value寫成了ref,或者ref寫成了value。