<?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:mvc="http://www.springframework.org/schema/mvc"
 xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <mvc:resources mapping="/images/**" location="/images/" />
<mvc:resources mapping="/css/**" location="/css/" />
<mvc:resources mapping="/googlefb2702e2c27e84b8.html" location="/googlefb2702e2c27e84b8.html" />上面是配置的静态资源,报了如下的错误。大概是什么原因造成的?有没有什么解决的思路?
======================================================================
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [resource-context.xml]
Offending resource: ServletContext resource [/WEB-INF/spring/app-context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 12 in XML document from ServletContext resource [/WEB-INF/spring/resource-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:resources'.

解决方案 »

  1.   

    你这个配置文件是不是叫resource-context.xml,这个文件要在web.xml中配置一个servlet,要不然容器怎么只要到加载这个文件?
      

  2.   

    我有配org.springframework.web.servlet.DispatcherServlet,用spingDispatcherServlet 指定静态资源的处理方式,
    <mvc:default-servlet-handler/>和<mvc:resources>都爆cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:resources'.这个异常,我使用的是spring 3.0.3,<mvc:default-servlet-handler/>是3.0.5才支持的,所以爆错误,但3.0就已经支持<mvc:resources>了啊。。不知道是什么原因了。
      

  3.   

    嗯嗯,http://zhidao.baidu.com/question/423748786.html,换成3.0.4吧