XML解析异常之 The processing instruction target matching "[xX][mM][lL]" is not allowed.
2014-01-17 11:03
435 查看
今天改个dwr.xml文件后,启动本地tomcat后控制台报错:
分析:
后来在网上搜已一下The processing instruction target matching "[xX][mM][lL]" is not allowed.说是因为xml文件前有空格,可我的xml文件前没有空格。经过仔细研究发现,我把<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">放在了<?xml version="1.0" encoding="UTF-8"?>之前,这跟xml文件前有空格同理。后来把<?xml version="1.0" encoding="UTF-8"?>提到了文件的最前面,并且去掉前面的空格后,重新启动就不再报错了。
org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124) at org.directwebremoting.impl.DwrXmlConfigurator.setInputStream(DwrXmlConfigurator.java:127) at org.directwebremoting.impl.DwrXmlConfigurator.setServletResourceName(DwrXmlConfigurator.java:82) at org.directwebremoting.impl.StartupUtil.configureFromDefaultDwrXml(StartupUtil.java:611) at org.directwebremoting.impl.StartupUtil.configureContainerFully(StartupUtil.java:726) at org.directwebremoting.servlet.DwrServlet.configureContainer(DwrServlet.java:109) at org.directwebremoting.servlet.DwrServlet.init(DwrServlet.java:68) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
分析:
后来在网上搜已一下The processing instruction target matching "[xX][mM][lL]" is not allowed.说是因为xml文件前有空格,可我的xml文件前没有空格。经过仔细研究发现,我把<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">放在了<?xml version="1.0" encoding="UTF-8"?>之前,这跟xml文件前有空格同理。后来把<?xml version="1.0" encoding="UTF-8"?>提到了文件的最前面,并且去掉前面的空格后,重新启动就不再报错了。
相关文章推荐
- XML解析异常之 The processing instruction target matching "[xX][mM][lL]" is not allowed.
- 由于空格引起的xml错误之The processing instruction target matching "[xX][mM][lL]" is not allowed以及the markup in the document prec
- XML问题: The processing instruction target matching "[xX][mM][lL]" is not allowed
- 成功解决问题[Fatal Error] test.xml:1:7: The processing instruction target matching "[xX][mM][lL]" is not allowed.
- xml The processing instruction target matching "[xX][mM][lL]" is not allowed
- 关于XML文件的异常:The processing instruction target matching "[xX][mM][lL]" is not allowed.
- xml文件不能被正确解析/The processing instruction target matching "[xX][mM][lL]" is not al
- org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed(转)
- The processing instruction target matching "[xX][mM][lL]" is not allowed
- The processing instruction target matching "[xX][mM][lL]" is not allowed.
- The processing instruction target matching "[xX][mM][lL]" is not allowed
- Parse Fatal Error at line 1 column 7: The processing instruction target matching "[xX][mM][lL]" is not allowed.
- xml中出现The processing instruction target matching "[xX][mM][lL]" is not allowed.
- The processing instruction target matching "[xX][mM][lL]" is not allowed.
- web.xml文件报错:The processing instruction target matching "[xX][mM][lL]" is not allowed.
- The processing instruction target matching "[xX][mM][lL] "is not allowed错误解决办法总结
- ofbiz fop 报错 The processing instruction target matching "[xX][mM][lL]" is not allowed
- The processing instruction target matching "[xX][mM][lL]" is not allowed
- The processing instruction target matching "[xX][mM][lL]" is not allowed.
- The processing instruction target matching "[xX][mM][lL]" is not allowed.