问题与分析

在web.xml中配置servlet节点时报错如下:

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

原因是init-param节点不能放在load-on-startup节点的后面,将init-param节点放置到前边就不再报这个错误了:

<servlet>
<servlet-name>resteasy-servlet</servlet-name>
<servlet-class>
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
</servlet-class> <init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>com.cbx.ws.rest.jaxrs.CbxApplication</param-value>
</init-param> <load-on-startup>2</load-on-startup>
</servlet>

web.xml报错:Invalid content was found starting with element 'init-param'的更多相关文章

  1. Ecliplse 重命名后web.xml 报错Attribute "xmlns" was already specified for element "web-app".

      报错信息:Attribute "xmlns" was already specified for element "web-app" 由于项目的重命名,出现 ...

  2. web.xml文件报错:cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'.

    <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" ...

  3. web.xml报错:cvc-complex-type.2.4.a: Invalid content was found starting with element 'async-supported'. One of '{"http://java.sun.com/xml/ns/javaee":init-param}' is expected.

    在写xml的时候又一次总是报cvc-complex-type.2.4.a: Invalid content was found starting with element 错误,还出现小红叉,在网上找 ...

  4. shiro中async-supported报错 cvc-complex-type.2.4.a: Invalid content was found starting with element 'async-supported'. One of '{"http://java.sun.com/xml/ns/ javaee":init-param}' is expected.

    最近都在研究shiro这个框架,今天实施了一下,就报了如下错误: cvc-complex-type.2.4.a: Invalid content was found starting with ele ...

  5. web.xml——Error: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 详细报错信息:cvc ...

  6. idea工程中web.xml报错Servlet should have a mapping

    搭建ssm工程过程中web.xml报错:Servlet should have a mapping ....但是mapping已经配置好了...如下图: 搜索无果,后来发现是工程的web.xml位置配 ...

  7. 【解决方案】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-r

    [JAVA错误] cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One o ...

  8. 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 错误,还出现小红叉,在网上找 ...

  9. cvc-complex-type.2.4.a: Invalid content was found starting with element ‘init-param’(转)

    在写xml的时候又一次总是报cvc-complex-type.2.4.a: Invalid content was found starting with element 错误,还出现小红叉,在网上找 ...

随机推荐

  1. mysql 查询 优化

    1.基本原则:优化数据访问 (1)是否想服务器请求了不需要的数据?提取超过需要的列,多表连接时提取所有列,提取所有列都会消耗不必要的资源,提取你所需要的列就可以了. (2)MySQL检查了太多的数据吗 ...

  2. HDU 6183 Color it cdq分治 + 线段树 + 状态压缩

    Color it Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 132768/132768 K (Java/Others) Pro ...

  3. archlinux yaourt安装 以及出错细节 database file for "archlinuxfr" does not exist.

    archlinux yaourt安装 但一直报错如下: :: Synchronizing package databases...      core is up to date extra is u ...

  4. mongodb与sql聚合对应图 M

    mongodb与sql聚合对应图 M - CSDN博客 http://blog.csdn.net/u011930016/article/details/49422425 SQL Terms, Func ...

  5. Session Timeout 与 $.ajaxSetup

    对于session过期跳转的问题,很简单,就是一个过滤器,然后判断session为空?跳转:继续.但是对于ajax的请求,需要做特殊处理,见下面代码中的 // 此处考虑ajax操作session过期的 ...

  6. BZOJ2163: 复杂的大门

    BZOJ2163: 复杂的大门 Description 你去找某bm玩,到了门口才发现要打开他家的大门不是一件容易的事……他家的大门外有n个站台,用1到n的正整数编号.你需要对每个站台访问一定次数以后 ...

  7. IDEA中Git的应用场景

    工作中多人使用版本控制软件协作开发,常见的应用场景归纳如下: 假设小组中有两个人,组长小张,组员小袁 场景一:小张创建项目并提交到远程Git仓库 场景二:小袁从远程git仓库上获取项目源码 场景三:小 ...

  8. DDD领域建模基本流程

    整理一个精简的DDD领域建模基本流程,供大家在DDD领域建模实践中进行参考. 搜集用户故事(用户的原始需求) 整理用户故事,抽出用例(用例表达了用户对系统的需求,定义了系统的边界以及系统外部角色和系统 ...

  9. oracle服务丢失的处理方法之OracleServiceORCL不存在示例

    oracle服务是oracle数据库的重要组成部分,下面就教您oracle服务丢失的处理方法,如果您之前遇到过oracle服务丢失的问题,不妨一看. 今天发现数据库服务器上的所有oracle服务都丢失 ...

  10. DEDE自定义表单显示提交时间|添加提交时间,获取ip的方法

    前提是后台自定义表单字段一定要有  “时间”,这里的acca_time <div class="tit">*咨询内容:</div> <div clas ...