org.xml.sax.SAXParseException

本文解决了Tomcat启动时出现的org.xml.sax.SAXParseException错误,主要原因是Spring配置文件中的XML文档描述与实际使用的jar包版本不符。文章详细介绍了如何通过调整XML文档中的schema引用以匹配正确的jar版本来解决该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

tomat在启动的时候,报错org.xml.sax.SAXParseException,是spring 的xml配置文件在解析时报错;归其原因有2:

一、文件的编码可能有误,在win7下可以正常解析,但是在linux环境下无法解析,所以此时设置编码格式为utf-8,

有事是因为中问注释的问题,可是删除中文注释

二,得看具体问题,我的错误是org.xml.sax.SAXParseException; lineNumber: 14; columnNumber: 74; schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans-4.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>.

注意http://www.springframework.org/schema/beans/spring-beans-4.0.xsd,而本人的jar包是3.2.3,原来是jar包版本与文档描述不符合,故改为http://www.springframework.org/schema/beans/spring-beans-3.0.xsd,问题迎刃而解

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值