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就行了。问题解决。

  • 相关阅读:
    【HIDS】关于HIDS的一些看法
    图片在容器内水平垂直居中显示
    C++ 实现Cholesky分解
    Minikube 安装和简单使用
    关于.net的一些记录
    C#将窗体Form嵌入主窗体Panel中的一些问题
    Pod持久化
    Maven打包包含jar包
    Adam
    [漏洞]DNS Server Spoofed Request Amplification DDoS
  • 原文地址:https://www.cnblogs.com/java-synchronized/p/8394952.html
Copyright © 2011-2022 走看看