以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DOM/SAX/XPath 』  (http://bbs.xml.org.cn/list.asp?boardid=11)
----  [求助]使用含中文文件名的Schema验证DOM时出错!  (http://bbs.xml.org.cn/dispbbs.asp?boardid=11&rootid=&id=11135)


--  作者:mxlong
--  发布时间:10/19/2004 6:16:00 PM

--  [求助]使用含中文文件名的Schema验证DOM时出错!
只要aSchemaFileName包含中文,就会抛下面的异常!
没有中文文件名,可以正常解析DOM,并读写!
Src:
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        dbf.setValidating(true);
        dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
        dbf.setAttribute(JAXP_SCHEMA_SOURCE, aSchemaFileName);
        DocumentBuilder db = dbf.newDocumentBuilder();
        ErrorChecker aErrorChecker = new ErrorChecker();
        db.setErrorHandler(aErrorChecker);
        myDoc = db.parse(aCfgFileName);
Exception:
Exception in thread "main" java.net.MalformedURLException: unknown protocol: d
 at java.net.URL.<init>(Unknown Source)
 at java.net.URL.<init>(Unknown Source)
 at java.net.URL.<init>(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
 at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
 at com.fujitsu.shun.dmt.gui.common.XMLTest.parse(XMLTest.java:87)
 at com.fujitsu.shun.dmt.gui.common.XMLTest.main(XMLTest.java:62)
--  作者:edwardq2266
--  发布时间:7/13/2005 9:06:00 AM

--  
顶一下 我以前用tomcat当应用服务器的时候不会出错,现在换成oas/ias就出现下面错误。

<?xml version="1.0" encoding="gb2312" ?>
<!-- 注意root的路径配置的最后一个字符不能是"/"或者"\",同时请注意大小写区分 -->

<resources root="E:/OraHome_1/j2ee/home/applications/lwoaapp/lwoaapp/WEB-INF/resource">
 <resource type="docword"    caption="文件字配置"   scope="应用管理"  factory="com.linewell.oa.docword.DocwordFactory"  bean="com.linewell.oa.docword.Docword"   dao="com.linewell.oa.dao.XmlResourceDAO" setter="com.linewell.oa.web.struts.impl.DocwordSetter" />


//------------------------------以下就是读取到root路径解析时出错了,这是为什么?
ERROR AJPRequestHandler-ApplicationServerThread-5 com.linewell.oa.admin.ResourcViewDataDomParser (ResourcViewDataDomParser.java:101) - --输入文件出错-----

java.net.MalformedURLException: unknown protocol: e
 at java.net.URL.<init>(URL.java:544)
 at java.net.URL.<init>(URL.java:434)
 at java.net.URL.<init>(URL.java:383)
 at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:214)
 at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:180)
 at oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:151)
 at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
 at com.linewell.oa.admin.ResourcViewDataDomParser.readXMLFile(ResourcViewDataDomParser.java:94)
 at com.linewell.oa.admin.ResourcViewDataDomParser.<init>(ResourcViewDataDomParser.java:61)
 at com.linewell.oa.admin.ResourceViewDataFactory.produce(ResourceViewDataFactory.java:17)
 at _jsp._default._index._jspService(_index.java:164)
 at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:347)
 at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
 at com.linewell.oa.web.filter.EncodingFilter.doFilter(EncodingFilter.java:82)
 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
 at com.linewell.oa.web.filter.LoginFilter.doFilter(LoginFilter.java:57)
 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:645)
 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
 at java.lang.Thread.run(Thread.java:534)


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
4,498.047ms