2010-06-17 24 views
0

InputStream is = this.getClass()。getResourceAsStream(「/ ParseExample/service1.xml」);GetResourceAsStream生成java.io.IOException:Root not accessible

上面的代碼生成java.io.IOException:Root不可訪問。

這是項目文件夾 http://www.fileden.com/files/2010/5/28/2872707//projectfiles.JPG

我怎樣才能正確定位文件的結構?應該使用什麼路徑?

+0

檢查你的jar文件,「service1.xml」必須在「ParseExample」裏面 – anupsth 2010-06-17 10:23:52

回答

1

您需要將文件放在jar中的/ res文件夾中,請參閱this示例。

+0

Got it!謝謝老兄:D – cancelledout 2010-06-18 02:18:38

相關問題