2021-05-12 14:32:11
Ubuntu 13.10 安裝 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.
網路抓包工具Wireshark的簡單使用 http://www.linuxidc.com/Linux/2013-05/84174.htm
Ubuntu 12.04 下安裝Wireshark http://www.linuxidc.com/Linux/2012-06/63582.htm
Linux中從普通使用者啟動Wireshark抓包 http://www.linuxidc.com/Linux/2012-06/63580.htm
Linux下安裝和執行Wireshark http://www.linuxidc.com/Linux/2014-09/106522.htm
相關文章