spring - 未能读取架构文档 'http://www.springframework.org/schema/beans/spring-beans-3.0.xsd'

标签 spring schema

在启动我的 Spring 应用程序时,我收到以下错误:

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如下:

<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>

请提出建议。

最佳答案

当我收到此错误消息时,这仅仅是因为我的 CLASSPATH 中缺少一个 jar。一些 spring 应用程序似乎对 spring jars 非常渴望。我的应用最终需要类路径中的所有这些:

${OTS_DIR}/org.springframework.aop-${VERSION}.jar:\
${OTS_DIR}/org.springframework.aspects-${VERSION}.jar:\
${OTS_DIR}/com.springsource.org.aopalliance-${AOPALLIANCE_VER}.jar:\
${OTS_DIR}/org.springframework.asm-${VERSION}.jar:\
${OTS_DIR}/org.springframework.beans-${VERSION}.jar:\
${OTS_DIR}/org.springframework.context-${VERSION}.jar:\
${OTS_DIR}/org.springframework.core-${VERSION}.jar:\
${OTS_DIR}/org.springframework.expression-${VERSION}.jar:\
${OTS_DIR}/org.springframework.jdbc-${VERSION}.jar:\
${OTS_DIR}/org.springframework.jms-${VERSION}.jar:\
${OTS_DIR}/org.springframework.orm-${VERSION}.jar:\
${OTS_DIR}/org.springframework.transaction-${VERSION}.jar:\
${OTS_DIR}/org.springframework.instrument-${VERSION}.jar

关于spring - 未能读取架构文档 'http://www.springframework.org/schema/beans/spring-beans-3.0.xsd',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12316288/

相关文章:

java - 将 Java Bean 从 Applet 发送到 Servlet

java - Telegram 最新层

数据库模式问题

android - 如何在Android上的SQLite数据库中实现 "Inheritance"关系

java - Spring Boot scanBasePackages 无法从依赖项中找到 bean

java - Spring + Hibernate + Envers + 多线程 - session 关闭

spring - Spring Security 的注销操作在移动应用程序请求中给出 302 错误。服务器端有什么解决方案吗?

ajax - Spring MVC 与 ajax 文件上传和 MultipartFile

schema - HBase:行键大小

json - Spark : How to parse a Array of JSON object using Spark