xml文件不能被正确解析/The processing instruction target matching "[xX][mM][lL]" is not allowed.

The processing instruction target matching "[xX][mM][lL]" is not allowed.
Exception:org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.

这个异常解释为:xml文件不能被解析,一般出现这样的问题在于xml格式上,并且问题多出现在xml文件的头部。我就是出现了这个问题。昨天还可以正常运行的,今天来了就运行不了了,很奇怪,查看了下错误信息,找到了原因。这是因为我的xml文件头部有两行空行,第三行才开始写

<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
的。

总结:<?xml version="1.0" encoding="UTF-8"?>前面不要有任何其他字符,如空格、回车、换行这些否则就会出现上面的异常。

org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed(转)的更多相关文章

  1. web.xml文件报错:The processing instruction target matching "[xX][mM][lL]" is not allowed.

    昨晚把我的项目上传到了gitlab,然后今天在公司从gitlab下载下来, 发现web.xml报错.

  2. 关于解决 The processing instruction target matching "[xX][mM][lL]" is not allowed

    在处理和保存XML文件时,出现The processing instruction target matching "[xX][mM][lL]" is not allowed 错误 ...

  3. (转)ERROR : The processing instruction target matching "[xX][mM][lL]" is not allowed.

    现象:ERROR   : The processing instruction target matching "[xX][mM][lL]" is not allowed. 异常解 ...

  4. Android报错:The processing instruction target matching "[xX][mM][lL]" is not allowed.

    报错!!! The processing instruction target matching "[xX][mM][lL]" is not allowed. Attention! ...

  5. The processing instruction target matching ''[xX][mM][lL]" is not allowed

    报错的来源是: <?xml version="1.0" encoding="UTF8"?> 解决方案::,一般是WSDL的头文件的格式出了问题,比如 ...

  6. 出现 The processing instruction target matching "[xX][mM][lL]" is not allowed错误

    错误原因与解决办法: 这个错误的原因是因为xml的开始有多余的空格造成的,只要把多余的空格删除就没有问题了. xml开始部分写注释也会出现此问题. 本文出自:艺意

  7. The processing instruction target matching &quot;[xX][mM][lL]&quot; is not allowed.

    现象: ERROR   : The processing instruction target matching "[xX][mM][lL]" is not allowed.  异 ...

  8. dom4j解析xml报错:Nested exception: org.xml.sax.SAXParseException: White space is required between the processing instruction target and data.

    采用dom4j方式解析string类型的xml xml:        String string="<?xmlversion=\"1.0\" encoding=\ ...

  9. IDEA运行TestNG报错rg.testng.TestNGException: org.xml.sax.SAXParseException;

    从eclipse复制的依赖注解,一运行测试脚本发现报错如下: "F:\Program Files\Java\jdk1.7.0_17\bin\java" -ea -Didea.lau ...

随机推荐

  1. 记录一次jmeter脚本开发缺少utf-8惹的祸

    背景:需要模拟余额发放,并进行大批量的发放,我就想到了jmeter.就是几个简单的接口,我想很简单,就上手,没想到最后鸡鸡,害我查了半天原因. 操作:我编写的脚本: 请求默认值的内容编码我也是为空,当 ...

  2. 基于 JavaEmail 简单的发送邮件点到点,一对多(图片和附件)之多收件人,多少送人

    if(!StringUtil.isEmpty(message_type_to)){ if (message_type_to.contains(",")) { String[] sp ...

  3. 群晖系统如何通过Video Station套件管理NAS中的视频

    一.PC端观看视频 1.在NAS套件中心找到Video Station套件,安装套件 2.设置video套件别名,便于后期使用,控制面板----应用程序门户----video Station 3.选中 ...

  4. Window Server2012 修改远程桌面端口号

    Win + R 输入 regedit 打开注册表编辑器 在注册表编辑器中找到 PortNumber 双击 PortNumber,选择10进制,修改想要的端口号 把修改的端口添加为入站规则 重启 Rem ...

  5. 微信公众号添加zip

    微信公众号添加zip的教程 我们都知道创建一个微信公众号,在公众号中发布一些文章是非常简单的,但公众号添加附件下载的功能却被限制,如今可以使用小程序“微附件”进行在公众号中添加附件. 以下是公众号添加 ...

  6. 谈谈MySql索引

    刚刚学习完丁奇老师<MySql 实战 45 讲>专栏中的索引部分,图文并茂的风格解开了我之前的许多疑惑,并且学习到许多新的东西,在此做个笔记,方便后续复习.由于 MySql 中存在多种存储 ...

  7. JavaScript笔记(二)

    一.JavaScript面向对象 1.类 constructor 构造函数 constructor() 方法是类的构造函数(默认方法),用于传递参数,返回实例对象,通过new命令生成实例时,自动调用该 ...

  8. java web应用启动报错:Caused by: java.lang.ClassNotFoundException: ServletContext

    ServletContext是个接口,不同的WEB容器(tomcat, jboss等)都有各自的实现. 一般是缺少servlet-api.jar包 在Java Build Path的Libraries ...

  9. C#LeetCode刷题之#520-检测大写字母(Detect Capital)

    问题 该文章的最新版本已迁移至个人博客[比特飞],单击链接 https://www.byteflying.com/archives/3947 访问. 给定一个单词,你需要判断单词的大写使用是否正确. ...

  10. 解读闭包,这次从ECMAScript词法环境,执行上下文说起

    对于x年经验的前端仔来说,项目也做了好些个了,各个场景也接触过一些.但是假设真的要跟面试官敞开来撕原理,还是有点慌的.看到很多大神都在手撕各种框架原理还是有点羡慕他们的技术实力,羡慕不如行动,先踏踏实 ...