Cause:
one minute in the cheerful debugging the program, the next second start projects under suddenly thrown exception, start-up failure, look at the error message:
The solution document 'http://www.springframework.org/schema/beans/spring-beans-4.1.xsd' cannot be read,
The reason is 1) the document cannot be found; 2) the document cannot be read; 3) the root element of the document is not <xsd:schema>
Problems to Google, of course, it is concluded that the reason is that the spring website sometimes convulsions or you don’t have access to the network is very poor can’t even http://www.springframework.org/schema/beans/spring-beans-4.1.xsd this address, anyway you can’t open the link address, your project belch fart.
What! How can you be so controlled by others?I began to search for a solution, and finally found a reasonable way to get the project to load local Spring-Beans-x.xsd files to get rid of the restrictions on network requests. First look at the local configuration file details:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:context="http://www.springframework.org/schema/context" xmlns:jms="http://www.springframework.org/schema/jms"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
My local solution is to replace http://www.springframework.org/schema/beans/spring-beans-4.1.xsd for the classpath:/org/springframework/beans/factory/XML/spring beans – 2.0 XSD, of course, you will doubt why replacement for spring beans – 2.0 XSD version rather than the other version?(I am using the idea in the development tools) CTRL + click http://www.springframework.org/schema/beans/spring-beans-4.1.xsd to selected files is the classpath:/org/springframework/beans/factory/XML/spring beans – 2.0 XSD other versions of the XSD I haven’t tried, anyone interested in can try; Once the replacement is complete, the annoying error message will no longer appear when you launch directly, and you can happily debug your project.
The end of 0927 project: Looking back at the above, I think I was really stupid. The problem with the above was that batch changes were not necessary, and the CLASSPATH syntax was also reported.
Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/beans/spring-beans-3.2.xsd]
Found XML schema [http://www.springframework.org/schema/beans/spring-beans-3.2.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-3.2.xsd
Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/context/spring-context-3.2.xsd]
Found XML schema [http://www.springframework.org/schema/context/spring-context-3.2.xsd] in classpath: org/springframework/context/config/spring-context-3.2.xsd
Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/tool/spring-tool-3.2.xsd]
Found XML schema [http://www.springframework.org/schema/tool/spring-tool-3.2.xsd] in classpath: org/springframework/beans/factory/xml/spring-tool-3.2.xsd
The above is the project startup loading information, which indicates that the project will automatically load the local XSD file when the project starts. The reason why the above problem occurs is that the 4.1.xsd version of the file I configured can only support the local version of 3.2.xsd file at most. When the network speed is good, the XSD file can be reached through HTTP request. However, when the network speed is not good enough to support the higher version of the XSD file locally, it will only report an error message, the project startup failed.
two solutions is obtained by the above analysis, one kind is to upgrade the high version of the jar package contains high version of the XSD file, the other is to reduce the XSD file version of the configuration makes the local jar can meet. The last sentence makes the local JAR meet the configured version of the XSD so that no exception messages will appear.