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

问题描述

启动Spring App时,出现以下错误:

While starting my Spring App, I am getting the following error :

WARNING: Ignored XML validation warning
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document     
'http://www.springframework.org/schema/beans/spring-beans-3.0.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>.

我的springapp-servlet.xml如下:

My springapp-servlet.xml is as follows :

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"        
xmlns:aop="http://www.springframework.org/schema/aop"      
xsi:schemaLocation="http://www.springframework.org/schema/beans   
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean name="/hello.htm" class="springapp.web.HelloController"/>
</beans>

请提出建议.

推荐答案

<beans 
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:security="http://www.springframework.org/schema/security"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

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

10-15 14:54