XML中报错

错误描述如下:

Multiple annotations found at this line:
- cvc-complex-type.2.4.a: Invalid content was found starting with element 'mapping-file'. One of '{"http://xmlns.jcp.org/xml/ns/persistence":shared-
cache-mode, "http://xmlns.jcp.org/xml/ns/persistence":validation-mode, "http://xmlns.jcp.org/xml/ns/persistence":properties}' is expected.
- Mapping file "orm-namedquery-config.xml" cannot be resolved.

解决前代码片段

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

解决后代码片段

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance http://www.springmodules.org/schema/cache/springmodules-cache.xsd http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd"

看出区别了吗,添加绿色部分即可!

原文地址:https://www.cnblogs.com/Alwaysbecoding/p/12324882.html