Question: org.xml.sax .SAXParseException: cvc-elt.1: Cannot find the declaration of element ‘beans’.
Solution: first, if the exception is encountered in the project, it is usually the problem that the project cannot download to the spring-beans-2.5.xsd file. The version number here varies with the project version.
Here you need to configure the local XSD file as follows:
Find the core package of spring referenced in your project, spring.jar
Open it with a compressed file and find the path
org/springframework/beans/factory/xml/
And configure the XSD file in this path to applicationContext.xml If there are more than one configuration file, all of them will be replaced
That is to say,
is the best choice
classpath:/org/springframework/beans/factory/xml/spring-beans-2.5.xsd
Instead of
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
Enables the configuration file to be read directly from the local
Reprint address: http://blog.csdn.net/wengang285/article/details/7587264
Method 2:
Modify spring applicationContext.xml Change the name space of the XML file to the following code:
<?xml version=”1.0″ encoding=”utf-8″?>
<!DOCTYPE beans PUBLIC “-//SPRING//DTD BEAN 2.0//EN” ” http://www.springframework.org/dtd/spring-beans-2.0.dtd “>
<beans>
Problem solving address: http://www.myexception.cn/vc-mfc/627052.html
The first method seems to have no effect, so I use the second method to solve the problem
Read More:
- How to Solve Error: Element ‘dependency’ cannot have character [children], because the type’s content type is element-
- How to Solve AspectJ error: error at ::0 can’t find referenced pointcut XXX
- How to Solve Error: “initializer element is not constant”
- [Solved] TS Error: Could not find a declaration file for module
- How to Solve Element Error: target is not existed: .page-component__scroll .el-scrollbar__wrap
- How to Solve Error: IncompleteElementException: Could not find result map…
- How to Solve Error: Type mismatch: cannot convert from Object to Car
- How to Solve Error: Cannot find module ‘webpack/lib/RequestShortener’
- How to Solve Koa Error: Cannot find module ‘koa-router‘
- How to Solve “Status bar could not find cached time string image. Rendering in-process.” in Xcode
- How to Solve Error “Could not find com.android.tools.build:gradle:3.0.1”
- How to Solve Loadrunner Error: Failed to find .cfg file
- How to Solve Error creating bean with name ‘log’loginController’
- How to Fix “initializer element is not constant” error
- SpringBoot Access Clickhouse Error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘jdbcConverter’ defined in class path resource [***.class]
- [Solved] org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘dataSource‘
- How to Solve SpringBoot MongoDB MongoAutoConfiguration Startup Error
- How to Solve Gradle Error: Plugin with id ‘jetty’ not found.
- How to Solve Spring Cloud Error context has been closed already
- How to Solve Error: Failed to load ApplicationContext