zoukankan      html  css  js  c++  java
  • nested exception is java.lang.IllegalStateException: Context namespace element 'annotation-config' a

    公司还用的是spring低版本,今天用jre 8测试了一下,发现错误:

    Unexpected exception parsing XML document from class path resource [applicationContext-dao.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,看源码是org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser自动检测,jdk版本检测时需要jre1.5以上版本,但是JdkVersion只检查到了1.7,jre1.8 时不匹配任何jdk。

    网上招到了解决的方法,https://my.oschina.net/u/553266/blog/825103

    网上的解决方法无非两种:降低jdk的版本或者修改spring-2.5.6.jar的源码.这些都不是我想要的。我查看了一下在spring-2.5.6jar的orgspringframeworkcore下有JdkVersion.class这个类,同时在spring-core.4.2.0.RELEASE也有这个类,所以在引入jar包的时候不需要引入spring-2.5.6jar只引入spring-core.4.2.0.RELEASE就行了。问题解决。

  • 相关阅读:
    mysql索引、group by、explain、insert delayed
    mysql学习笔记
    Handler
    文件操作
    RatingBar
    ListView(二)
    文件管理函数的草稿
    SAX解析XML
    phpunit
    Service(一)
  • 原文地址:https://www.cnblogs.com/java-synchronized/p/8394952.html
Copyright © 2011-2022 走看看