在Spring2.5+JDK1.8时 使用context.annotation出错

来源:互联网 发布:类似精易编程助手 编辑:程序博客网 时间:2024/06/06 19:46

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [beans.xml]; nested exception is java.lang.IllegalStateException: Context namespace element ‘annotation-config’ and its parser class [org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser] are only available on JDK 1.5 and higher

报错提示说context.annotation必须是jdk1.5以上的版本才支持,那为何1.8的jdk会出错呢?

阅读了spring2.5的源码得知:原因在与spring2.5时 jdk还只发布到1.7的版本 所以 1.8版本无法识别就当成低于1.5的版本报错了。。

解决方法:
1.换1.5-1.7版本的jdk
2,换更高版本的spring

0 0
原创粉丝点击