2 Replies Latest reply on Feb 14, 2013 8:28 AM by fan kam thong

    SAXParserImpl.parse UnknownHostException

    fan kam thong Newbie

      I am having SAXParserImpl.parse UnknownHostException with the following codes running in JBoss 7.1.3 with RedHat v6.x. Anyone has valuable pointers to the solution ?

       

      My codes are as following:

       

                      //get a factory

                                    SAXParserFactory spf = SAXParserFactory.newInstance();

                                    spf.setValidating(false);

       

                                    spf.setFeature("http://xml.org/sax/features/validation", false);

                                    spf.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false);

                                    spf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);

                                    spf.setFeature("http://xml.org/sax/features/external-general-entities", false);

                                    spf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);

       

                                    //get a new instance of parser

                                    SAXParser sp = spf.newSAXParser();

       

                                    //parse the file and also register this class for call backs

                                    //sp.parse(fileName, this);

                                    sp.parse(fileName, new org.xml.sax.helpers.DefaultHandler(){

                                  public org.xml.sax.InputSource resolveEntity(String publicId, String systemId)

                                          throws org.xml.sax.SAXException, java.io.IOException {

                                      System.out.println("Ignoring: " + publicId + ", " + systemId);

                                      return new org.xml.sax.InputSource(new java.io.StringReader(""));

                                  }

       

       

      Exception

      18:29:16,471 ERROR [stderr] (ServerService Thread Pool -- 74) java.net.UnknownHostException: root

      18:29:16,472 ERROR [stderr] (ServerService Thread Pool -- 74)   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)

      18:29:16,472 ERROR [stderr] (ServerService Thread Pool -- 74)   at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

      18:29:16,472 ERROR [stderr] (ServerService Thread Pool -- 74)   at java.net.Socket.connect(Socket.java:529)

      18:29:16,473 ERROR [stderr] (ServerService Thread Pool -- 74)   at java.net.Socket.connect(Socket.java:478)

      18:29:16,473 ERROR [stderr] (ServerService Thread Pool -- 74)   at sun.net.NetworkClient.doConnect(NetworkClient.java:163)

      18:29:16,473 ERROR [stderr] (ServerService Thread Pool -- 74)   at sun.net.NetworkClient.openServer(NetworkClient.java:118)

      18:29:16,473 ERROR [stderr] (ServerService Thread Pool -- 74)   at sun.net.ftp.FtpClient.openServer(FtpClient.java:488)

      18:29:16,473 ERROR [stderr] (ServerService Thread Pool -- 74)   at sun.net.ftp.FtpClient.openServer(FtpClient.java:475)

      18:29:16,474 ERROR [stderr] (ServerService Thread Pool -- 74)   at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:270)

      18:29:16,474 ERROR [stderr] (ServerService Thread Pool -- 74)   at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:352)

      18:29:16,474 ERROR [stderr] (ServerService Thread Pool -- 74)   at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)

      18:29:16,475 ERROR [stderr] (ServerService Thread Pool -- 74)   at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)

      18:29:16,475 ERROR [stderr] (ServerService Thread Pool -- 74)   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

      18:29:16,475 ERROR [stderr] (ServerService Thread Pool -- 74)   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

      18:29:16,475 ERROR [stderr] (ServerService Thread Pool -- 74)   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

      18:29:16,476 ERROR [stderr] (ServerService Thread Pool -- 74)   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

      18:29:16,476 ERROR [stderr] (ServerService Thread Pool -- 74)   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)

      18:29:16,476 ERROR [stderr] (ServerService Thread Pool -- 74)   at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)

      18:29:16,476 ERROR [stderr] (ServerService Thread Pool -- 74)   at javax.xml.parsers.SAXParser.parse(SAXParser.java:277)

      18:29:16,476 ERROR [stderr] (ServerService Thread Pool -- 74)   at com.tecforte.aggregator.util.xml.XMLParser.parseXML(XMLParser.java:1