cvccomplextype。2。4。c:通配符的匹配很全面,但无法找到元素context:componentscan的声明一。异常描述 在配置SpringMVC的时候,spring。xml文件中配置了, 结果提示如下异常:Causedby:org。xml。sax。SAXParseException;lineNumber:9;columnNumber:71;cvccomplextype。2。4。c:通配符的匹配很全面,但无法找到元素context:componentscan的声明 二。错误原因 一般是因为这个spring。xml文件中的命名空间依赖型没有声明完整,一些必要的依赖项没有添加进来,尤其是利用IDE工具自动生成的xml文件,很多时候依赖项都不完整!!! 三。解决办法 复制完整的命名空间。beansxmlnshttp:www。springframework。orgschemabeansxmlns:xsihttp:www。w3。org2001XMLSchemainstancexmlns:contexthttp:www。springframework。orgschemacontextxmlns:mvchttp:www。springframework。orgschemamvcxsi:schemaLocationhttp:www。springframework。orgschemabeanshttp:www。springframework。orgschemabeansspringbeans4。2。xsdhttp:www。springframework。orgschemamvchttp:www。springframework。orgschemamvcspringmvc4。2。xsdhttp:www。springframework。orgschemacontexthttp:www。springframework。orgschemacontextspringcontext4。2。xsd 这样就可以解决该问题了。 对内容有疑问可添加微信号:codingbb