无法读取架构文档

无法读取架构文档

本文介绍了schema_reference.4:无法读取架构文档'http://www.springframework.org/schema/beans/spring-beans-4.1.5.xsd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在eclipse中的spring-dispatcher.xml中遇到错误,如下所示.

I get an error in spring-dispatcher.xml in eclipse as given below.

schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-
 beans-4.1.5.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root
 element of the document is not <xsd:schema>.

我有最新的spring库...

I have latest spring libraries...

spring-beans-4.1.5.RELEASE.jar
spring-beans-4.1.5.RELEASE-javadoc.jar
spring-beans-4.1.5.RELEASE-sources.jar
spring-context-4.1.5.RELEASE.jar
spring-context-4.1.5.RELEASE-javadoc.jar
spring-context-4.1.5.RELEASE-sources.jar
spring-context-support-4.1.5.RELEASE.jar
spring-context-support-4.1.5.RELEASE-javadoc.jar
spring-context-support-4.1.5.RELEASE-sources.jar
spring-webmvc-4.1.5.RELEASE.jar
spring-webmvc-4.1.5.RELEASE-javadoc.jar
spring-webmvc-4.1.5.RELEASE-sources.jar
spring-webmvc-portlet-4.1.5.RELEASE.jar
spring-webmvc-portlet-4.1.5.RELEASE-javadoc.jar
spring-webmvc-portlet-4.1.5.RELEASE-sources.jar

spring-dispatcher.xml,如下所示...

spring-dispatcher.xml as given below...

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE beans>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-4.1.5.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-4.1.5.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc.xsd">

如果能获得帮助,那将非常好...具有相同主题的帖子无法帮助我解决此问题.谢谢...

It would be great if I get some help... The posts with same subject did not help me to resolve this.Thanks in advance...

推荐答案

该错误是因为找不到xsd.请尝试执行以下使用特定版本4.1的操作.

The error is because it could not find the xsd. Try doing the below which is using a specific version 4.1.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE beans>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-4.1.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc.xsd">

或者,如果您不提及版本,它将尝试使用最新版本.

Or if you don't mention a version, it will try to use the latest.

<?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE beans>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework/schema/context"
        xmlns:mvc="http://www.springframework.org/schema/mvc"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd">

这篇关于schema_reference.4:无法读取架构文档'http://www.springframework.org/schema/beans/spring-beans-4.1.5.xsd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 09:38