Nested exception is Java.lang.IllegalStateException:Context namespace element ' Annotation-config ' a

Source: Internet
Author: User

The company also uses the low spring version, which was tested today with JRE 8 and found an error:

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 [O Rg.springframework.context.annotation.AnnotationConfigBeanDefinitionParser] is only available on JDK 1.5 and higher, See the source code is org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser automatic detection, JDK version detection needs to jre1.5 above version, but jdkversion only check The 1.7,jre1.8 does not match any JDK.

On the Internet to solve the method, https://my.oschina.net/u/553266/blog/825103

There are two ways to solve the problem on the Web: reduce the JDK version or modify the Spring-2.5.6.jar source. None of this is what I want. I took a look at the org\springframework\core\ in Spring-2.5.6jar. There are jdkversion.class this class, at the same time in the Spring-core.4.2.0.release also have this class, so in the introduction of the jar package does not need to introduce Spring-2.5.6jar only to introduce spring-core.4.2.0.release on the line. Problem solving.

Nested exception is Java.lang.IllegalStateException:Context namespace element ' Annotation-config ' a

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.