项目在本地运行正常,打包放在服务器上之后出现了以下报错
Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 13 in XML document from class path resource [spring-servlet.xml] is
invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 82; cvc-complex-type.2.4.c: The matching wildcard is strict, bu
t no declaration can be found for element 'context:component-scan'.
......
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>.
打包的过程中spring-servlet.xml文件中有时候出现报错,有时候不会出现,不影响打包的过程。
从错误提示来看,是解析spring-servlet.xml文件的时候找不到解析标签用的xsd文件,或是xsd文件不正常导致解析出错
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:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context" xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-m