在spring使用annotation時錯誤

在運行啓動時有下面的錯誤

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.internalRequiredAnnotationProcessor': Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'order' of bean class [org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor]: No property 'order' found
Caused by: org.springframework.beans.InvalidPropertyException: Invalid property 'order' of bean class [org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor]: No property 'order' found
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:376)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1105)


在spring 2.0.6包中的RequiredAnnotationBeanPostProcessor這個類沒有order屬性

這時把spring的包更新成2.5.6的就可以了,看代碼,確實有order這個屬性

private int order = Ordered.LOWEST_PRECEDENCE - 1;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章