2013-12-09 2 views
-1

XmlSlurper를 사용하여 XML 파일을 구문 분석하려고합니다.Groovy에서 XmlSlurper를 사용하는 NoRouteToHostException

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

이를 실행하면 저를 가져옵니다 : 나는 다음과 같은 코드가

나는 문제없이 XmlSlurper() parstText (...)를 할 수 있어요, 그리고 내가 얻을 수 있었다
java.net.NoRouteToHostException: No route to host. 

. 파일을 사용하여 :

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

구문 분석() newFile 전달할 경우 여전히 경로 없음 예외가 발생합니다. 이견있는 사람?

감사합니다.

답변

0

아, 문제는 XML 파일의 일부 헤더 정보에있는 것처럼 보입니다.