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,问题迎刃而解