Spring profile parsing failed at system startup, "Cvc-elt.1: Cannot find the declaration of element ' Beans ' exception

Source: Internet
Author: User

Symptom: Spring load config file applicationcontext.xml error, throw nested exception is og.xml.sax.SAXParseException; linenumber:12; columnnumber:47; Cvc-elt.1: Could not find exception information for the declaration r of element ' beans ' .

There are two causes of this exception: first, the configuration file header configuration of the XSD version information is incorrect, resulting in an error parsing. Spring header xsd or DTD check files are found in two steps, first from the local jar package, If found, then verify with the local jar package (you can find the definition of the XSD file location in the Spring-schemas file under Meta-inf in Spring-beans.jar or Spring-context.jar), and if not found, second-step lookup, it will try to get from the network Download the file and verify that the above exception is thrown if the system is disconnected or downloaded. Workaround: Change the version of the XSD file defined in Applicationcontext.xml to the version of XSD defined in the Spring jar package. If the version definition is too high, it cannot be found locally and can only be downloaded from the network. For example, my spring jar package is 3.0.5 version, but my XSD write is 3.2, sometimes if the system is disconnected or downloaded will be reported this problem, the 3.2 changed to 3.0 to solve. Second, this problem can also occur in the absence of xmlns= "Http://www.springframework.org/schema/beans" in the DTD. Workaround: Add xmlns= "Http://www.springframework.org/schema/beans in the spring configuration file to resolve.

Spring profile parsing failed at system startup, "Cvc-elt.1: Cannot find the declaration of element ' Beans ' exception

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.