qq_筑城以北_04274162
2017-04-17 21:00
我写的程序老是出现这么错误,百思无果,复制老师的代码之后依然出现该错误(后面就连Xml内容都一样)。以下是错误
java.net.MalformedURLException: unknown protocol: g
at java.net.URL.<init>(URL.java:600)
at java.net.URL.<init>(URL.java:490)
at java.net.URL.<init>(URL.java:439)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:620)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:148)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:805)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:177)
at com.imooc.dom.Domtext.kjtext(Domtext.java:26)
at com.imooc.dom.Domtext.main(Domtext.java:132)
可能是你文件的路径包含空格或者非法字符
Java眼中的XML---文件读取
83199 学习 · 431 问题
相似问题