簡而言之,我想學習一點Spring。問題是,當我部署我的應用程序,春加載XML文件並遇到此異常:當Spring試圖加載XML文件時,防止W3.org發現503錯誤
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 8 in XML document from ServletContext resource [/WEB-INF/spring-servlet.xml] is invalid;
nested exception is oracle.xml.parser.schema.XSDException:
Server returned HTTP response code: 503 for URL:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
....
我發現,這是由W3引起誰的重複請求下載他們的DTD文件返回503(見here詳細信息)。有沒有什麼辦法讓Spring使用緩存版本?另外,我會怎麼做呢?我的環境包括Glassfish v3,Spring v2.5.6,Spring Web Flow v2.0.8和NetBeans 6.8
問題是,文件中沒有提到DTD。下面是我的spring-servlet.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:webflow="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config.xsd">
....
</beans>
乾杯
是的,事情是DTD沒有提到那裏 – Sevas 2010-02-15 22:58:18
間接,它是。只需加上-1.0即可閱讀http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd。您所指的模式文件是一個XHTML文檔。 – andi5 2010-02-16 17:36:34