NoRouteToHostException using XmlSlurper in Groovy

91 views Asked by At

I am trying to parse an XML file using XmlSlurper. I have the following code:

import groovy.util.XmlSlurper
def newIssue = new XmlSlurper().parse(new File("1234-export.xml"))

Running this gets me:

java.net.NoRouteToHostException: No route to host.

I am able to do XmlSlurper().parstText( ... ) without problems, and I was able to get the file using:

def newFile = new File("1234-export.xml")

I still get the no route exception if I try to pass newFile to parse() though. Any thoughts?

Thanks!

1

There are 1 answers

0
Jess On

Ah, it looks like the problem was with some header information that the XML file had.