首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

使用URLConnection获取InputStream失败解决办法

2012-01-22 
使用URLConnection获取InputStream失败服务器是Linux,使用SecureCRT是可以连接通的。代码如下:URL url nu

使用URLConnection获取InputStream失败
服务器是Linux,使用SecureCRT是可以连接通的。
代码如下:
URL url = null;
URLConnection connection = null;
filePath = "/export/home/sysm/ftproot/ebc/exportCounter/counter_20111103072421663145.xml";
url = new URL("http://10.147.212.70/" + filePath);
connection = url.openConnection();
input = connection.getInputStream();

得到connection过后,通过它获取inputStream是失败的。

请问是什么原因。谢谢


[解决办法]
http://wdwheyr.iteye.com/blog/1055509
LZ你参考下呢
[解决办法]
debug看看connection是不是null,

如果不为空,,又读不到数据,,那看看是不是权限问题。。。
[解决办法]

探讨

http://wdwheyr.iteye.com/blog/1055509
LZ你参考下呢

热点排行