公司还用的是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的org\springframework\core\下有JdkVersion.class这个类,同时在spring-core.4.2.0.RELEASE也有这个类,所以在引入jar包的时候不需要引入spring-2.5.6jar只引入spring-core.4.2.0.RELEASE就行了。问题解决。

转载于:https://www.cnblogs.com/java-synchronized/p/8394952.html

nested exception is java.lang.IllegalStateException: Context namespace element 'annotation-config' a相关推荐

  1. java.lang.IllegalStateException: Context namespace element ‘annotation-config’ and its parser class

    项目中用的是spring低版本(2.5.6),今天用jre 8测试了一下,发现错误: Unexpected exception parsing XML document from class path ...

  2. Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous map

    Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous map ...

  3. nested exception is java.lang.IllegalStateException: refreshAfterWrite requires a LoadingCache异常解决

    nested exception is java.lang.IllegalStateException: refreshAfterWrite requires a LoadingCache异常解决 问 ...

  4. spring boot 启动 nested exception is java.lang.IllegalStateException

    2019独角兽企业重金招聘Python工程师标准>>> 在启动spring boot 项目时报错,之前都是OK的,只是我引用了内置的tomcat包就报错了 <dependenc ...

  5. methodinvocationexception: property ‘driverclassname‘ threw exception; nested exception is java.lang

    抛出异常: "D:\Program Files\Java\jdk1.8.0_131\bin\java.exe" "-javaagent:D:\Program Files ...

  6. 报错记录:SprintBoot---Unable to start embedded container; nested exception is java.lang……

    报错信息 练习一个SpringBoot的小例子后,报出以下错误:Unable to start embedded container; nested exception is java.lang.No ...

  7. Factory method ‘redisConnectionFactory‘ threw exception; nested exception is java.lang.NoClassDefFou

    Factory method 'redisConnectionFactory' threw exception; nested exception is java.lang.NoClassDefFou ...

  8. Factory method ‘sqlSessionFactory‘ threw exception; nested exception is java.lang.NoSuchMethodError:

    springboot 引入mybatis-plus后报错: Factory method 'sqlSessionFactory' threw exception; nested exception i ...

  9. 【日常Exception】第二十四回:nested exception is java.lang.NoClassDefFoundError: redis/clients/jedis/util/Pool

    热门系列: 程序人生,精彩抢先看 日常异常,是否也有你似曾相识的那一个 1.问题 近期遇到的一个异常问题如题所示,下面是完整的异常内容,原景重现: PropertyAccessException 1: ...

最新文章

  1. 程序员学历低,该被歧视吗? | 每日趣闻
  2. 2021泰晤士世界大学排名公布,中国137所高校上榜!
  3. 怎样用C语言数码管编写E1显示程序,跪求单片机0~99数码管显示用C语言编写的程序...
  4. C/C++之vector的内存管理和效率
  5. 前端学习(2975):路由传参的两种方式
  6. 电脑显示服务器负载信息失败,线上服务mcelog负载异常分析处理流程
  7. python写的软件怎么逆向_python逆向工程:通过代码生成类图
  8. STL里面的sort()函数使用结构体
  9. CentOS 手工编译、手动编译安装 MongoDB
  10. win7卸载显卡及对应驱动后桌面分辨率不对以及鼠标键盘无反应
  11. CSP202009-2 风险人群筛查(100分)【序列处理】
  12. AB=0与伴随矩阵相互作用型题
  13. 经验分享:vim编辑器的常用命令使用汇总
  14. swift moya框架+rxswift+handyjson+SwiftyJSON封装和使用教程
  15. 澳大利亚:令人钦羡的高福利国家 - 老牛的日志 - 网易博客
  16. 输电线路覆冰智能预测预警系统
  17. MyEclipse 使用教程
  18. 安装spark的详细步骤
  19. android厨房的使用方法,懒人生活的福音:Android在厨房_软件资讯技巧应用-中关村在线...
  20. mocha.opts配置文件

热门文章

  1. CSS3 background-image背景图片相关介绍
  2. 解决:Unknown table engine 'InnoDB'
  3. JavaScript基础——处理字符串
  4. Android 之 Shape (圆角输入框)
  5. oracle基本概念和术语
  6. Java 调用http接口(基于OkHttp的Http工具类方法示例)
  7. JAVA中文字符串编码--GBK转UTF-8
  8. github 创建新项目
  9. XMLHTTP使用具体解释
  10. [原创]SQL 表值函数:获取从今天计算起往前自定义天数