公司还用的是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就行了。问题解决。

nested exception is java.lang.IllegalStateException: Context namespace element 'annotation-config' a的更多相关文章

  1. spring低版本报错:java.lang.IllegalStateException: Context namespace element ‘annotation-config’ and its parser class [*] are only available on

    参考来源:http://blog.csdn.net/sunxiaoyu94/article/details/50492083 使用spring低版本(2.5.6),使用jre 8发现错误: Unexp ...

  2. nested exception is java.lang.IllegalStateException: Cannot forward after response has been committed

    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is ...

  3. Springboot 上传报错: Failed to parse multipart servlet request; nested exception is java.lang.IllegalStateException: The multi-part request contained parameter data (excluding uploaded files) that exceede

    Failed to parse multipart servlet request; nested exception is java.lang.IllegalStateException: The ...

  4. SpringBoot整合Elasticsearch启动报错处理 nested exception is java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8]

    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean wit ...

  5. spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes

    spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web serv ...

  6. Request processing failed; nested exception is java.lang.IllegalStateException: getOutputStream() has already been called for this response

    问题分析: 在ServletRequest servletRequest中已经存在一个项目名称,此时,又用项目名称访问 http://localhost:8080/rent/pdf/preview r ...

  7. nested exception is java.lang.IllegalStateException: No persistence units parsed from {classpath*:META-INF/persistence.xml}

    Deploying inside Eclipse v3.6 raises the exception. The WEB-INF/classes/ folder in the .war doesn't ...

  8. springboot 报错nested exception is java.lang.IllegalStateException: Failed to check the status of the service xxxService No provider available for the service

    spring: dubbo:#关闭所有服务的启动时检查:(没有提供者时报错) consumer: check: false timeout: 3000

  9. Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'wfsj'; nested exception is java.lang.Ill

    异常信息如下: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value ...

随机推荐

  1. Atitit.mysql oracle with as模式临时表模式 CTE 语句的使用,减少子查询的结构性 mssql sql server..

    Atitit.mysql  oracle with as模式临时表模式 CTE 语句的使用,减少子查询的结构性 mssql sql server.. 1. with ... as (...) 在mys ...

  2. PCI总线 DMA burst 基本概念

    转载地址:http://blog.csdn.net/sunjiajiang/article/details/7945057 DMA和burst不是一个概念. DMA传送不经过CPU的控制,假如硬盘的数 ...

  3. [vt]xenserver磁盘扩容扩不大问题解决

    xenserver将磁盘扩大后,fdisk可以看到容量大了,但是df -h看到磁盘并没有大,解决. 参考 说明:XenServer里面安装的虚拟机,分区的时候采用的是LVM磁盘分区 需求:现在需要扩容 ...

  4. Nokia Imaging SDK滤镜使用入门

    简要说明: 通过对示例图片分别运用 LomoFilter和SketchFilter两个滤镜(Nokia Imaging SDK 内置), 来学习滤镜的基本使用和参数的设置.本工程的代码量比较少,也很容 ...

  5. oracle锁表,杀死进程

    查询锁表数据 select object_name,machine,s.sid,s.serial#from v$locked_object l,dba_objects o ,v$session swh ...

  6. Python 内置模块函数filter reduce

    1.filter()实现过滤的功能 2.reduce()对序列中元素的连续操作可以通过循环来处理 3.map()对tuple元组进行解包操作,调用时设置map()的第一个参数为None 4.使用red ...

  7. eclipse配置xml的自动提示

    如mybatis的mapper配置文件: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE ...

  8. js、jquery遍历对象

    js遍历对象: var obj = {a:1,b:2,c:3} for(var s in obj){ alert(obj[s]); } jquery遍历对象: var obj = {a:1,b:2,c ...

  9. Spider Studio 新版本 (x-mas) - 可以引入第三方程序集, 可以将脚本生成为DLL

    Merry X'mas! Spider Studio本年度最后一次重大更新发生在圣诞节, 又是一次美好的巧合 :) 本次更新主要包含两个重要功能: 1. 引入第三方程序集 在"设置" ...

  10. Python高级编程之生成器(Generator)与coroutine(二):coroutine介绍

    原创作品,转载请注明出处:点我 上一篇文章Python高级编程之生成器(Generator)与coroutine(一):Generator中,我们介绍了什么是Generator,以及写了几个使用Gen ...