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

http://blog.csdn.net/niu_hao/article/details/25250213

在写xml的时候又一次总是报cvc-complex-type.2.4.a: Invalid content was found starting with element 错误,还出现小红叉,在网上找了很多,有说是把报红叉的代码写在<jsp-config></jsp-config>之间,试了之后发现完全没用。

后来在外文网站上找到了一个方法就把问题解决了

解决办法为:将“http://www.springmodules.org/schema/cache/springmodules-cache.xsd http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd”这段话加入到xml文件的"xmlns:xsi="的标签中

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
  3. 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"    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
  4. http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
  5. ">

这样就不报错了

时间: 2024-11-03 09:01:45

cvc-complex-type.2.4.a: Invalid content was found starting with element 错误的相关文章

Type cvc-complex-type.2.4.a: Invalid content was found starting with element &#39;build&#39;.错误的解决方法

项目突然间爆出了这样的问题: Description Resource Path Location Typecvc-complex-type.2.4.a: Invalid content was found starting with element 'build'. One of '{"http://maven.apache.org/POM/4.0.0":parent, "http://maven.apache.org/POM/4.0.0":name, "

cvc-complex-type.2.4.a: Invalid content was found starting with element &#39;async-supported&#39;

<servlet> <servlet-name>springMVC</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value&g

cvc-complex-type.2.4.a: Invalid content was found starting with element &#39;display-name&#39;

cvc-complex-type.2.4.a: Invalid content was found starting with element 'display-name'. One of '{"http://xmlns.jcp.org/xml/ns/javaee":servlet-class, "http://xmlns.jcp.org/xml/ns/javaee":jsp-file, "http://xmlns.jcp.org/xml/ns/javae

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 'display-name'. One of '{"http://xmlns.jcp.org/xml/ns/javaee":servlet-class, "http://xmlns.jcp.org/xml/ns/javaee":jsp- file, "http://xmlns.jcp.org/xml/ns/java

web.xml 中async-supported爆红叉叉 cvc-complex-type.2.4.a: Invalid content was found starting with element &#39;async-supported&#39;.

新建一个项目在web.xml中些东西是发现async-supported报红叉 cvc-complex-type.2.4.a: Invalid content was found starting with element 'async-supported'. 找了好多终于发现了把表头修改一下就行了,这是一个简单的解决方法: <?xml version="1.0" encoding="UTF-8"?><web-app version="2

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

web.xml 出现cvc-complex-type.2.4.a: Invalid content was found starting with element <web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance  http://www.springmodules.

web.xml文件报错:cvc-complex-type.2.4.a: Invalid content was found starting with element &#39;init-param&#39;.

cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One of '{"http:// xmlns.jcp.org/xml/ns/javaee":enabled, "http://xmlns.jcp.org/xml/ns/javaee":async-supported, "http:// xmlns.jcp.org/xml/ns/java

关于cvc-complex-type.2.4.d: Invalid content was found starting with element &#39;mvc:exclude-mapping&#39;. No child element is expected at this point.的血坑

百度了好多大多数都是一样的解决方案,出现这个问题看看是不是 <mvc:exclude-mapping path="/login"/>放到<bean class="com.fan.qx.web.LoginInterceptor"></bean>下面了,正确的配置: <!-- 配置登陆拦截器 -->     <mvc:interceptors>      <mvc:interceptor>     

配置文件报错:cvc-complex-type.2.4.a: Invalid content was found starting with element filter

配置文件filter元素报错解决办法:解决办法为:将"http://www.springmodules.org/schema/cache/springmodules-cache.xsd http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd"这段话加入到xml文件的"xmlns:xsi="的标签中 如下所示:{ <?xml version="1.0" encod