勿忘初心

叹人生、不如意事,十常八九

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

ubuntu 13.10 install wireshark

今天在使用java jsoup操作remote server的是否,在本地执行可以成功返回内容,然后打成jar包,使用shell在 server上执行就反问错误。

java.net.SocketException: Unexpected end of file from server
sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:772)
sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:769)
sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323)
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:516)
org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:493)
org.jsoup.helper.HttpConnection.execute(HttpConnection.java:205)
org.jsoup.helper.HttpConnection.get(HttpConnection.java:194)

在stackoverflow 上面找到同样的问题,原因是remote server 接收request,并立马关闭了request,而没有返回response;具体原因得看 trace packets,so,得安装wireshark

sudo apt-get install wireshark

但是没有那么顺利,不然就不会有这边文章了。

因为执行上面的命令之后,发现如下错误:

404  Not Found [IP: 137.189.4.14 80]

sudo apt-get update 也没有办法解决,

然后baidu了一下,发现了这边blog有办法。发现是因为ubuntu13.10 这个版本的源有变化导致的。
更新为14.04可以解决,但是这可是正在运行的服务器,不敢冒着险。不过也可以更新源。

mv /etc/apt/sources.list /etc/apt/sources.list_20150807
touch /etc/apt/sources.list
vi /etc/apt/sources.list

然后copy一下内容

deb http://old-releases.ubuntu.com/ubuntu/ raring main universe restricted multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu/ raring-security main universe restricted multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring-security main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu/ raring-updates main universe restricted multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring-updates main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ raring-proposed main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring-proposed main restricted universe multiverse

然后保存退出。

 sudo apt-get update
 sudo apt-get install wireshark
 done.
posted on 2015-08-07 16:17  chensss2008  阅读(240)  评论(0编辑  收藏  举报