我已经在工作中运行了一个应用程序 3 年时间,但突然之间它决定失败。我无法弄清楚是否涉及网络问题或完全不同的东西。
堆栈跟踪:
java.lang.NullPointerException
at sun.net.www.protocol.http.NegotiateAuthentication.isSupported(NegotiateAuthentication.java:99)
at sun.net.www.protocol.http.AuthenticationHeader.parse(AuthenticationHeader.java:180)
at sun.net.www.protocol.http.AuthenticationHeader.<init>(AuthenticationHeader.java:126)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1374)
at domain.ActivationSMSReceiverMain.processLogFromUrl(SMSSys.java:327)
at domain.ActivationSMSReceiverMain.<init>(SMSSys.java:45)
at domain.ActivationSMSReceiverMain.main(SMSSys.java:477)
代码示例:
URL url = new URL(uri);
HttpURLConnection uc = (HttpURLConnection) url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream()));
我已确保uri
格式正确(http://www.blah/?something)。
响应头:
HTTP 200 No Error
Content-Type: text/html
Cache-Control: private
Content-Length: 127364
X-Powered-By: ASP.NET
Server: Microsoft-IIS/6.0
Date: Sat, 17 Aug 2013 10:31:25 GMT