问题一:cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:component-scan'.
解决办法:
beans 中增加绿色部分的context、spring-context。 具体引用可查看spring-context-4.3.5.RELEASE.jar下的META-INF/spring-schemas文件。
<beans xmlns="
http://www.springframework.org/schema/beans"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd"
>
配置: <context:component-scan base-package="com.demo.controller" />
问题二:
1、
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element
'mvc:annotation-driver'.
解决办法:
增加如下绿色部分
XML schemes
2、cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 'mvc:annotation-
driven' 的声明。
<beans xmlns="
http://www.springframework.org/schema/beans"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="
http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
">
<mvc:annotation-driven />