Today, I am using javajsoup to check whether the remoteserver can be operated. If I run it locally, I can return the content successfully, compress it into a jar package, and use shell to execute it on the server. Java.net. SocketException: Unexpectedendoffilefromserversun.net. www. http. HttpClient. parseHTTPHeader (HttpClient. j
Today, I am using java jsoup to operate on the remote server. If I run it locally, I can return the content successfully, compress it into a jar package, and run the shell on the server to ask the error.
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.exe cute (HttpConnection. java: 516)
Org.jsoup.helper.HttpConnection$Response.exe cute (HttpConnection. java: 493)
Org.jsoup.helper.HttpConnection.exe cute (HTTP connection. java: 205)
Org. jsoup. helper. HttpConnection. get (HttpConnection. java: 194)
The same problem was found in stackoverflow because the remote server received the request and immediately disabled the request, but did not return the response. For details, see trace packets and so. wireshark must be installed.
Sudo apt-get install wireshark
But it is not so smooth, otherwise there will be no such article.
After executing the preceding command, the following error is found:
404 Not Found [IP: 137.189.4.14 80]
Sudo apt-get update cannot be solved,
Then baidu finds out that there is a solution to this blog. It is found that the source of Ubuntu13.10 has changed.
Updating to 14.04 can solve the problem, but this is a running server and does not risk it. However, you can also update the source.
Mv/etc/apt/sources. list/etc/apt/sources. list_20150807
Touch/etc/apt/sources. list
Vi/etc/apt/sources. list
Then copy the content.
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)
Save and exit.
Sudo apt-get update
Sudo apt-get install wireshark
Done.
Http://www.linuxidc.com/Linux/2013-05/84174.htm for simple use of network packet capture tool Wireshark
Install Wireshark http://www.linuxidc.com/Linux/2012-06/63582.htm in Ubuntu 12.04
Starting Wireshark packet capture http://www.linuxidc.com/Linux/2012-06/63580.htm from common users in Linux
Install and run Wireshark http://www.linuxidc.com/Linux/2014-09/106522.htm in Linux
Wireshark details: Click here
Wireshark: Click here
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-08/121326.htm