[jdom-interest] Reading from a file across the net

Peter Donn PDonn at orygen.com
Wed Sep 12 07:06:46 PDT 2001


Hi
I'm having problems building a Document for a file that is on another server
on the network.  I pass the file as demonstrated in the following code.
WHen I do this I get the error:
	"org.jdom.JDOMException: Error in building: Connection refused: no
further information"

yet I can successfully pass the file into a FileInputStream(new
File(sXMLFile)) and read a byte from it.

Is this a bug?  Am I doing something wrong?
Any help would be gratefully received.

Cheers
Peter.

-------------------------------------
The code...

	p_sXMLFile =
"//lon-ws-01/Orygen/ApplicationXmlFiles/exampleTimesheetApplication.xml"

and using the following code:

	try {
		SAXBuilder builder = new SAXBuilder();
		System.out.println("About to build");
      Document doc = builder.build(new File(p_sXMLFile));
		System.out.println("Built");
      return doc;
   } catch(JDOMException e) {
   	e.printStackTrace();
   } catch(NullPointerException e) {
      e.printStackTrace();
   }

----------------------------------
The output (a bit more than for the code listed above)

This file exists
Value = 60
Done
Inside ApplicationBean constructor
The file
\\lon-ws-01/Orygen/ApplicationXmlFiles/exampleTimesheetApplication.xml
exists
Done
About to build
org.jdom.JDOMException: Error in building: Connection refused: no further
information
	java.lang.Throwable(java.lang.String)
	java.lang.Exception(java.lang.String)
	org.jdom.JDOMException(java.lang.String, java.lang.Throwable)
	org.jdom.Document
org.jdom.input.SAXBuilder.build(org.xml.sax.InputSource)
	org.jdom.Document org.jdom.input.SAXBuilder.build(java.net.URL)
	org.jdom.Document org.jdom.input.SAXBuilder.build(java.io.File)
	org.jdom.Document
com.orygen.web.ApplicationBean.readApplicationProperties(java.lang.String)
	com.orygen.web.ApplicationBean(java.lang.String)
	void com.orygen.web.Tester.main(java.lang.String [])

Root cause: java.net.ConnectException: Connection refused: no further
information
	java.lang.Throwable(java.lang.String)
	java.lang.Exception(java.lang.String)
	java.io.IOException(java.lang.String)
	java.net.SocketException(java.lang.String)
	java.net.ConnectException(java.lang.String)
	void java.net.PlainSocketImpl.socketConnect(java.net.InetAddress,
int)
	void java.net.PlainSocketImpl.doConnect(java.net.InetAddress, int)
	void java.net.PlainSocketImpl.connectToAddress(java.net.InetAddress,
int)
	void java.net.PlainSocketImpl.connect(java.net.InetAddress, int)
	java.net.Socket(java.net.InetAddress, int, java.net.InetAddress,
int, boolean)
	java.net.Socket(java.lang.String, int)
	java.net.Socket sun.net.NetworkClient.doConnect(java.lang.String,
int)
	void sun.net.NetworkClient.openServer(java.lang.String, int)
	void sun.net.ftp.FtpClient.openServer(java.lang.String, int)
	sun.net.ftp.FtpClient(java.lang.String)
	void sun.net.www.protocol.ftp.FtpURLConnection.connect()
	java.io.InputStream
sun.net.www.protocol.ftp.FtpURLConnection.getInputStream()
	java.io.InputStream java.net.URL.openStream()
	void
org.apache.crimson.parser.InputEntity.init(org.xml.sax.InputSource,
java.lang.String, org.apache.crimson.parser.InputEntity, boolean)
	void
org.apache.crimson.parser.Parser2.parseInternal(org.xml.sax.InputSource)
	void
org.apache.crimson.parser.Parser2.parse(org.xml.sax.InputSource)
	void
org.apache.crimson.parser.XMLReaderImpl.parse(org.xml.sax.InputSource)
	org.jdom.Document
org.jdom.input.SAXBuilder.build(org.xml.sax.InputSource)
	org.jdom.Document org.jdom.input.SAXBuilder.build(java.net.URL)
	org.jdom.Document org.jdom.input.SAXBuilder.build(java.io.File)
	org.jdom.Document
com.orygen.web.ApplicationBean.readApplicationProperties(java.lang.String)
	com.orygen.web.ApplicationBean(java.lang.String)
	void com.orygen.web.Tester.main(java.lang.String [])


**********************************************************************
Privileged, confidential and/or copyright information may be contained
in this e-mail. This e-mail is for the use only of the intended
addressee. If you are not the intended addressee, or the person
responsible for delivering it to the intended addressee, you may not
copy, forward, disclose or otherwise use it or any part of it in any
way whatsoever. To do so is prohibited and may be unlawful.

If you receive this e-mail by mistake please advise the sender
immediately by using the reply facility in your e-mail software.

Orygen (UK) Limited may monitor the content of e-mails sent and
received via its network for the purposes of ensuring compliance with
its policies and procedures.

This message is subject to and does not create or vary any contractual
relationship between Orygen (UK) Limited and you
**********************************************************************





More information about the jdom-interest mailing list