# problem bei xml lesen mit jdom



## nibblas (12. Jun 2008)

moin

ich möchte eine xml datei einlesen.

dazu habe ich jdom installiert.

hier mein code:

```
package IPA.copy;

import java.io.IOException;

import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;


public class xmlTest {

	/**
	 * @param args
	 * @throws IOException 
	 * @throws JDOMException 
	 */
	public static void main(String[] args) throws JDOMException, IOException {
		// TODO Auto-generated method stub
		Document doc = new SAXBuilder().build( "//IPA//copy//test.xml" ); 
		Element party = doc.getRootElement();
		//System.out.println(party);
	}

}
```

weshalb krieg ich da socket und ftp client exceptions? irgendwie nicht logisch....


```
Exception in thread "main" java.net.UnknownHostException: IPA
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
	at java.net.Socket.connect(Socket.java:519)
	at java.net.Socket.connect(Socket.java:469)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
	at sun.net.NetworkClient.openServer(NetworkClient.java:118)
	at sun.net.ftp.FtpClient.openServer(FtpClient.java:488)
	at sun.net.ftp.FtpClient.openServer(FtpClient.java:475)
	at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:270)
	at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:352)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:653)
	at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
	at org.jdom.input.SAXBuilder.build(SAXBuilder.java:489)
	at org.jdom.input.SAXBuilder.build(SAXBuilder.java:928)
	at IPA.copy.xmlTest.main(xmlTest.java:20)
```


----------



## Wildcard (12. Jun 2008)

"//IPA//copy//test.xml"
Was soll das denn für ein Pfad sein?


----------



## nibblas (12. Jun 2008)

klar der ist falsch... geändert funzt...


----------

