xom报错 Exception in thread "main" java.net.UnknownHostException: file
2014-10-11 01:29
337 查看
Exception in thread "main" java.net.UnknownHostException: file at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.Socket.connect(Socket.java:579) at java.net.Socket.connect(Socket.java:528) at sun.net.ftp.impl.FtpClient.doConnect(FtpClient.java:958) at sun.net.ftp.impl.FtpClient.tryConnect(FtpClient.java:918) at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1013) at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:999) at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:294) at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:393) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:613) at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:189) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:812) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648) at nu.xom.Builder.build(Unknown Source) at nu.xom.Builder.build(Unknown Source) at xml2.XOM.main(XOM.java:26)
package xml2; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import nu.xom.Builder; import org.xml.sax.XMLReader; public class XOM { public static void main(String[] args) throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(false); factory.setNamespaceAware(true); SAXParser parser = factory.newSAXParser(); XMLReader reader = parser.getXMLReader(); reader.setErrorHandler(new SimpleErrorHandler()); Builder builder = new Builder(reader); builder.build("contacts.xml"); } }
为什么会报这个错误呢?我用的是xom-1.2.10.jar
package xml2; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import nu.xom.Builder; import org.xml.sax.XMLReader; public class XOM { public static void main(String[] args) throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(false); factory.setNamespaceAware(true); SAXParser parser = factory.newSAXParser(); XMLReader reader = parser.getXMLReader(); reader.setErrorHandler(new SimpleErrorHandler()); Builder builder = new Builder(reader); builder.build("file:\\H:\\mycodes\\java\\jbpm\\xml2\\contacts.xml"); } }
从xom-1.2.10.jar开始使用file协议,挺不方便的
相关文章推荐
- Exception in thread "main" java.lang.IncompatibleClassChangeError: net/sf/cglib/core/DebuggingClassW
- Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
- react native Exception in thread "main" java.util.zip.ZipException: error in opening zip file
- react native Exception in thread "main" java.util.zip.ZipException: error in opening zip file
- react native Exception in thread "main" java.util.zip.ZipException: error in opening zip file
- exception in thread "main" java.lang.RuntimeException: java.lang.IllegalArgumentException: java.net.
- Exception in thread "main" javax.jms.JMSException: java.net.ConnectException: C nnection refused:
- spark Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxException: Re
- 安装Hive过程中,出现Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxExcepti
- blackberry 模拟器 上网设置(Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file)
- Exception in thread "main" java.lang.IllegalArgumentException: Not a host:port pair: PBUF
- Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
- Exception in thread "main" java.net.BindException: Address already in use: JVM_Bind
- IO流复制文件Exception in thread "main" java.io.FileNotFoundException: A (拒绝访问。) 异常
- 执行打的maven jar包时出现“Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes”
- Android错误:项目导入时,出现Exception in thread "main" java.lang.NoClassDef、Could not write file 。。。.classpath
- Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
- Exception in thread "main" java.net.BindException: Address already in use: JVM_Bind
- Exception in thread "main" java.io.FileNotFoundException
- spark程序异常:Exception in thread "main" java.io.IOException: No FileSystem for scheme: hdfs