cvc-complex-type.2.4.a: Invalid content was found starting with element

前端之家收集整理的这篇文章主要介绍了cvc-complex-type.2.4.a: Invalid content was found starting with element前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

cvc-complex-type.2.4.a: Invalid content was found starting with element


在写xml的时候又一次总是报cvc-complex-type.2.4.a: Invalid content was found starting with element 错误.



解决方法如下:

在eclipse中配置xmlcatalog


1、Location: D:\LIB\springmodules-cache.xsd(springmodules-cache.xsd在本地的路径)
Key Type: Namespace Name
Key: http://www.springmodules.org/schema/cache/springmodules-cache.xsd
2、Location: D:\LIB\springmodules-ehcache.xsd(本地路径)
Key Type: Schema Location
Key: http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd


以上两个配置文件下载配置文件 (http://download.csdn.net/detail/pplsunny/9764322)



然后再将这连个xsd加入到web.xml中就搞定了

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 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" 
xmlns="http://java.sun.com/xml/ns/javaee" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
id="WebApp_ID" 
version="2.5">


==============

原文链接:https://www.f2er.com/xml/294404.html

猜你在找的XML相关文章