首页 > spring mvc启动报错

spring mvc启动报错

tomcat启动,报如下错,请问如何处理?

2015-12-31 20:36:28,263 [ERROR] org.springframework.web.servlet.DispatcherServlet - Context initialization failed 
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 8 in XML document from ServletContext resource [/WEB-INF/servlet-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 74; cvc-elt.1: 找不到元素 'beans' 的声明。

servlet-context.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans="http://www.springframework.org/schema/beans" xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-4.2.xsd 
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-4.2.xsd">

    <context:component-scan base-package="com.baobaotao.web" />
    <bean
        class="org.springframework.web.servlet.view.InternalResourceViewResolver"
        p:prefix="/WEB-INF/views/" p:suffix=".jsp" />
</beans>

有可能是引的包,和你声明的4.2.xsd不一致

【热门文章】
【热门文章】