cvc-complex-type.2.4.c: ...is strict, ...declaration found element"context:property-placeholder"

GitHub上的項目,導入兩次。第一次把問題解決了,然後第二次有傻傻地給忘了,Mark一下

在pom.xml中加入ibatis依賴如下:

<dependency>
    <groupId>org.apache.ibatis</groupId>
    <artifactId>ibatis-core</artifactId>
    <version>3.0</version>
</dependency>


當然,在Stack Overflow上看到了類似錯誤,其原因與解決方法如下:

You have this:

xmlns:mvc="http://www.springframework.org/schema/mvc"

but you're not mentioning it here:

xsi:schemaLocation="
http://www.springframework.org/schema/beans     
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-3.0.xsd">

To fix that, you should have

http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd

there as well, like

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/context 
http://www.springframework.org/schema/context/spring-context-3.0.xsd">

Note: it is actually common that schema references don't mention Spring version to allow for easier upgrading, so you could use references like http://www.springframework.org/schema/context/spring-context.xsd as well.

源網址請戳:https://stackoverflow.com/questions/19218122/cvc-complex-type-2-4-c-the-matching-wildcard-is-strict-but-no-declaration-can
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章