`
Rainbow702
  • 浏览: 1073185 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类

"cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One of '{"http://java.sun.com/xml/ns/javaee":run-as, "http://java.sun.com/ xml/ns/javaee":security-role-ref}' is expected." 的解决方法

阅读更多

项目使用的是Spring MVC,之前使用的 web.xml 使用的是2.4版本的,今天把它升级至2.5版本,但是升级之后,spring mvc 的 servlet 的声明报错了:

<servlet>
    <servlet-name>apps</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>5</load-on-startup>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:resources/applicationContext.xml</param-value>
    </init-param>
</servlet>

报的错如下:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One of '{"http://java.sun.com/xml/ns/javaee":run-as, "http://java.sun.com/
 xml/ns/javaee":security-role-ref}' is expected.

这个问题怎么解决呢?其实很简单,只要将“<load-on-startup>5</load-on-startup>”调个位置就好了,见下面:

<servlet>
    <servlet-name>apps</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:resources/applicationContext.xml</param-value>
    </init-param>
    <load-on-startup>5</load-on-startup>
</servlet>

 

分享到:
评论

相关推荐

    cvc-complex-type.2.4.d: Invalid content was found

    在XML Schema设计中,"cvc-complex-type.2.4.d: Invalid content was found" 是一个常见的错误信息,这通常意味着在解析XML文档时,遇到了不符合定义的复杂类型的内容。这个错误通常涉及到XML Schema的约束规则,即...

    解决:dubbo找不到dubbo.xsd报错

    - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document '...

    springmodules-cache.xsd&springmodules-ehcache.xsd.rar

    cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. One of '{"http:// java.sun.com/xml/ns/javaee":include-prelude, ...

    dubbo找不到dubbo.xsd报错

    - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document '...

    spring配置文件解析失败报”cvc-elt.1: 找不到元素 &#39;&#39;beans&#39;&#39; 的声明”异常解决

    当遇到“cvc-elt.1: 找不到元素 'beans' 的声明”这种异常时,通常意味着Spring在尝试解析XML配置文件时遇到了问题。这个错误提示表明XML解析器无法找到`&lt;beans&gt;`元素的定义,这是一个基本的Spring配置文件结构元素...

    dubbo.xsd文件下载

    - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document 'http:// code....

    Matlab高阶谱分析(HOSA)工具箱及安装方法

    org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'area'. One of '{MathWorksID, type}' is expected. 运行hosaver: Warning: Could not find an exact ...

    dubbo.xsd 约束文件 解决标签识别报红

    - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document '...

    解决dubbo找不到dubbo.xsd报错

    - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document '...

    dubbo.xsd文件资源

    - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document '...

    spring-mvc-3.0.xsd

    cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:resources' 报错

    spring xsd文件

    描述中的错误 "cvc-complex-type.2.4.a: Invalid content was found starting with element 错误" 是一种常见的XML验证错误,意味着在XML文档中找到了不符合预期或不合法的元素。这通常发生在尝试添加一个不被其父...

    Eclipse打开时“发现了以元素’d:skin’”开头的无效内容。此处不应含有子元素的解决方法

    本文实例讲述了Android使用Eclipse 打开时“发现了以元素’d:skin’”开头的无效内容。此处不应含有子元素的解决方法。分享给大家供大家参考,具体如下: 今天打开 Eclipse 时遇到了这个提示,如图所示: ...

    最完整的CVC-ClinicDB数据集

    CVC-ClinicDB 是MICCAI 2015 结肠镜视频自动息肉检测子挑战赛训练阶段的官方数据集。该数据库由从结肠镜检查视频中提取的612张静态图像组成,这些图像来自29个不同的序列。每张帧图像都附带有一个真值(ground truth...

    javascript经典例子

    function add(a, b) { return a + b; } ``` 在JavaScript中,事件处理也是经典的应用之一。当用户与网页交互(如点击按钮、提交表单等)时,可以触发预先定义的JavaScript代码执行。例如,我们可以为一个按钮添加...

    计算机视觉中心-01行人数据集(CVC-01PedestrianDataset).pdf

    计算机视觉中心-01行人数据集(CVC-01PedestrianDataset) 计算机视觉中心-01行人数据集(CVC-01PedestrianDataset)是一种用于评估行人检测算法的数据库,该数据库记录了巴塞罗那周围的行人数据,并由CVC ADAS小组...

    使用dubbo时需要的dubbo.xsd

    使用 dubbo 时需要添加 dubbo 支持,否则会报错 。cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'.

    常见人脸识别数据库(YALE人脸数据库+YALE人脸数据库b)

    常见人脸识别数据库YALE人脸数据库(美国,耶鲁大学)http://cvc.cs.yale.edu/cvc/projects/yalefaces/yalefaces.html由耶鲁大学计算视觉与控制中心创建,包含15位志愿者的165张图片,包含光照、表情和姿态的变化。...

    CVC-T Endoscene 息肉数据集

    CVC-T 数据集是一个更广泛的数据集的测试集,称为 Endoscene。CVC-T 由从 36 名患者获得的 44 个视频序列中获得的 60 张图像组成。 一度找不到这个单独的数据集,但其实是包含在一整个医学分割网络的训练策略里的,...

Global site tag (gtag.js) - Google Analytics