nested exception is java.lang.IllegalStateException: Context namespace element 'annotation-config' a
2017-09-05 11:24
901 查看
公司还用的是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就行了。问题解决。
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: @Resource annotation requires a single-arg meth
- Caused by: java.lang.IllegalStateException: Context namespace element 'annotation-config' and its pa
- nested exception is java.lang.IllegalStateException: No persistence units parsed from {classpath*:META-INF/persistence.xml}
- java.lang.IllegalArgumentException: <session-config> element is limited to 1 occurrence
- nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map ***
- nested exception is java.lang.IllegalStateException: Cannot forward after response has been committed
- failed; nested exception is java.lang.IllegalStateException: Failed to introspect bean class [com.pu
- Invocation of init method failed; nested exception is java.lang.IllegalStateException:
- java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [or
- nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframewo
- spring低版本报错:java.lang.IllegalStateException: Context namespace element ‘annotation-config’ and its parser class [*] are only available on
- nested exception is java.lang.IllegalStateException: Encountered invalid @Scheduled method
- java.lang.IllegalArgumentException:A ServletContext is required to configure default servlet handlin
- nested exception is java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate'
- 访问页面异常:nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
- nested exception is java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for
- java.lang.IllegalArgumentException: <session-config> element is limited to 1 occurrence 分类: Tomcat 2014-12-09 11:20 512人阅读 评论(0) 收藏
- spring3.2.0与mybatis3.2.7整合出错--Failed to read candidate component class--nested exception is java.lang.IllegalArgumentException
- Java.lang.IllegalArgumentException: prefix wsdp is not bound to a namespace。
- nested exception is java.lang.IllegalArgumentException: Parameter with that position [1] did not exi