【发布时间】:2010-02-16 06:57:46
【问题描述】:
简而言之,我正在尝试学习一点 Spring。问题是,当我部署我的应用程序时,Spring 加载 XML 文件并遇到此异常:
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 引起的,因为 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>
干杯
【问题讨论】: