web.xml报错:Invalid content was found starting with element 'init-param'
问题与分析
在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'的更多相关文章
- Ecliplse 重命名后web.xml 报错Attribute "xmlns" was already specified for element "web-app".
报错信息:Attribute "xmlns" was already specified for element "web-app" 由于项目的重命名,出现 ...
- 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" ...
- 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 错误,还出现小红叉,在网上找 ...
- 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 ...
- 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 ...
- idea工程中web.xml报错Servlet should have a mapping
搭建ssm工程过程中web.xml报错:Servlet should have a mapping ....但是mapping已经配置好了...如下图: 搜索无果,后来发现是工程的web.xml位置配 ...
- 【解决方案】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 ...
- 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 错误,还出现小红叉,在网上找 ...
- 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 错误,还出现小红叉,在网上找 ...
随机推荐
- LeetCode——Binary Tree Level Order Traversal
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, ...
- Struts2的运行流程及其工作原理
1 服务开启,配置文件初始化 2 用户访问login请求 3 进入web.xml文件中我们配置的核心控制器(filter) 4 核心过滤器中有一个FilterDispatcher,FilterDisp ...
- BZOJ2163: 复杂的大门
BZOJ2163: 复杂的大门 Description 你去找某bm玩,到了门口才发现要打开他家的大门不是一件容易的事……他家的大门外有n个站台,用1到n的正整数编号.你需要对每个站台访问一定次数以后 ...
- oracle中去掉文本中的换行符、回车符、制表符
一.特殊符号ascii定义 制表符 chr(9) 换行符 chr(10) 回车符 chr(13) UPDATE tc_car_order set USE_REASON = REPLACE('USE ...
- oracle服务丢失的处理方法之OracleServiceORCL不存在示例
oracle服务是oracle数据库的重要组成部分,下面就教您oracle服务丢失的处理方法,如果您之前遇到过oracle服务丢失的问题,不妨一看. 今天发现数据库服务器上的所有oracle服务都丢失 ...
- C/S转分布式数据库的解决方法
C/S转分布式数据库的解决方法1. 直接VPN建一个网不就行了.(大概是虚拟成一个网络)2. 直连也可以,就是速度慢3. 还是三层吧,推荐RTC4. 弄个花生壳硬件试试呢,成本低,不用改程序5. 搞一 ...
- HDU3416 Marriage Match IV —— 最短路径 + 最大流
题目链接:https://vjudge.net/problem/HDU-3416 Marriage Match IV Time Limit: 2000/1000 MS (Java/Others) ...
- [原创]java合并word文件
需求背景 在互联网教育行业,做内容相关的项目经常碰到的一个问题就是如何动态生成一张word试卷.事先把题库中的每一道试题都已经保存成一个独立的word文件了,但是在选择了部分试题生成一张word试卷的 ...
- 两次跳转后session丢失
public ActionResult index() { Session["a"] = "aaa"; System.Web.HttpContext.Curre ...
- [Selenium] 操作 警告框、提示框、确认框
以如下页面为例: http://sislands.com/coin70/week1/dialogbox.htm 示例代码: pachage com.learningselenium.normalweb ...