java spring的拦截器配置出错了,求解

错误信息:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodBeforeAdviceImpl' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'advice' of bean class [advice.MethodBeforeAdviceImpl]: Bean property 'advice' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
请高人帮忙分析一下

没有可以让容器注入的方法 看看是不是方法名称 成员名写错了之类的
仔细给你分析下:
Error creating bean with name 'methodBeforeAdviceImpl' 就是说Bean的名字为“methodBeforeAdviceImpl”的这个类创建的时候出错,出什么错呢——
Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException在容器注入属性值的时候出错,
在哪个属性上出错呢----Invalid property 'advice' of bean class ,属性为“advice”出错。
Bean property 'advice' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Bean的属性“advice”不可写或者没有提供一个setter方法,setter方法参数的类型是否和getter方法返回值类型一致?
大概就是这个意思。就是说你Bean的advice属性的getter或者setter方法出错,你自己检查下。
纯手打 希望能帮到你

另:这些错误都是显而易见的,有一点英文基础的都看得懂吧,即使不懂,错误信息里面的关键字看了也猜到是怎么回事了,还有就是异常的类名都是望文生义的
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答