(Spring loads XML) Org.xml.sax.saxparseexception:cvc-elt.1:cannot find the declaration of element ' beans '.

Source: Internet
Author: User

ApplicationContext CTX = new Classpathxmlapplicationcontext ("Test.xml"); error

When you start spring, the following error is reported,

The reason is that the version of the XSD in XML is not configured inconsistently, I'm using spring-2.5.6, but the configuration file has a 3.0. You can change it as follows:

[XHTML]View plain copy < param name= "allowfullscreen" value= "false" >< param name= "wmode" value= "Transparent" >
    1. <? Xml version= "1.0"   Encoding= "UTF-8" ?>  
    2. <beans  Xmlns= "Http://www.springframework.org/schema/beans" &NBSP;&NBSP;
    3.     xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "&NBSP;&NBSP;
    4.  xsi:schemalocation=>  

In addition, when configuring, pay attention to the encoding of the configuration file, otherwise, when compiling, the output encoding and your configuration file encoding inconsistent, will produce garbled files.

(Spring loads XML) Org.xml.sax.saxparseexception:cvc-elt.1:cannot find the declaration of element ' beans '.

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.