[英]Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans-3.2.3.xsd'
[英]Failed to read schema document http://www.springframework.org/schema/beans/spring-context.xsd
當我使用IntelliJ使用Spring時,我收到以下錯誤消息:
無法讀取架構文檔“ http://www.springframework.org/schema/beans/spring-context.xsd ”,因為1)找不到該文檔; 2)文件無法閱讀; 3)文檔的根元素不是。
幫忙。
我在xsi:schemaLocation中使用了錯誤的url
相反,如果使用:
http://www.springframework.org/schema/beans/spring-context.xsd
我應該使用:
http://www.springframework.org/schema/context/spring-context.xsd
這解決了我的問題。 我通過觸發器檢查了這個問題,瀏覽器在bean內沒有spring-context.xsd可用。
希望你們中的一些人可以提供幫助。
@Indrajeet:正確的spring.xml或application-context.xml格式:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/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">
<context:component-scan base-package="com.demo" />
<mvc:annotation-driven/>
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/view/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.