java.net.UnknownHostException when xml file is transformed on separate driv
843834Apr 20 2005 — edited Nov 22 2007Hi:
I am applying XSLT on a XML formatted file to merge some attributes
and elements from a source xml file into a destination xml file. I am
using DOM Parser for this.
Consider the source XML file say source.xml is on C:\ on a windows
box. The xslt to be applied to source.xml is on D:\ on the same box.
The destination file is on D:\ on the same box. The resultant merge
after the XSLT happens on the destination file on D:\ so after the
xslt is complete, the destination file on D:\ contains the merged
changes from the source and the destination according to the rules
specified in the xslt.
Apparently when i run the parser (as part of some java prog using jdk
1.4.2) to carry out the above operation, I get the following exception
from the parser when its about to read parse the source xml file to
carry out the transform. Note the "c" in the below exception is the
name of the drive.
@ java.net.UnknownHostException: c
@ at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
@ at java.net.Socket.connect(Socket.java:452)
@ at java.net.Socket.connect(Socket.java:402)
@ at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
@ at sun.net.NetworkClient.openServer(NetworkClient.java:118)
@ at sun.net.ftp.FtpClient.openServer(FtpClient.java:423)
@ at sun.net.ftp.FtpClient.<init>(FtpClient.java:692)
at
@ sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:175)
at @ sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java
:257)
@ at java.net.URL.openStream(URL.java:913)
at oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2292)
at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:266)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:238)
I checked the URL passed at
oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2292) and its
getting returned correctly.
The URL passed is --
URL in_xml_url = new URL("file://" + getSpec( ));
where
getSpec( ) returns the path to the source configuration xml file on
the filesystem.
This exception with the parser DOES NOT occur when both the source and
destination xml files are on the same drive.
What could be the cause of this issue?
Please advise.
Thanks.