{"id":522,"date":"2016-05-16T19:39:05","date_gmt":"2016-05-16T11:39:05","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=522"},"modified":"2016-09-04T17:51:01","modified_gmt":"2016-09-04T09:51:01","slug":"java%e5%b8%b8%e8%a7%81%e7%9a%8414%e5%a4%a7%e5%bc%82%e5%b8%b8%e5%92%8c%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=522","title":{"rendered":"Java\u5e38\u89c1\u768412\u5927\u5f02\u5e38\u548c\u89e3\u51b3\u529e\u6cd5"},"content":{"rendered":"<p>\n\t<u>\u544a\u8bc9\u4f60\u4ec0\u4e48\u662f\u7ecf\u9a8c\uff0c\u7ecf\u9a8c\u5c31\u662f\u8fd9\u4e9b\u4e1c\u897f\u6211\u90fd\u7ecf\u5386\u8fc7\uff0c\u5e76\u4e14\u5f97\u5230\u4e86\u6211\u7684\u9a8c\u8bc1\uff01\u6700\u8fd1\u6709\u7f51\u53cb\u95ee\u6211ClientAbortException: &nbsp;java.io.IOException\u600e\u4e48\u89e3\u51b3\uff1f\u8bb2\u4e86\u534a\u5929\uff0c\u5bf9\u65b9\u8fd8\u6ca1\u660e\u767d\uff0c\u540e\u6765\u6211\u5c31\u6574\u7406\u4e86\u4e00\u4e2a\u6587\u6863\uff0c\u53d1\u7ed9\u5979\u3002\u73b0\u5206\u4eab\u7ed9\u5927\u5bb6\uff01<\/u><br \/>\n\t<span style=\"font-family:comic sans ms,cursive\"><strong>java.lang.ArithmeticException<\/strong><br \/>\n\t\u7b97\u672f\u8fd0\u7b97\u5f02\u5e38,\u56e0\u4e3a\u9664\u6570\u4e3a0\uff0c\u6240\u4ee5\u5f15\u53d1\u4e86\u7b97\u6570\u5f02\u5e38<br \/>\n\t<strong>java.lang.StringIndexOutOfBoundsException: String index out of range: -1<\/strong><br \/>\n\t\u8fd9\u662f\u622a\u53d6\u5b57\u7b26\u4e32substring()\u4ea7\u751f\u7684\u4e0b\u6807\u8d8a\u754c\u5f02\u5e38\u3002\u539f\u56e0\u662f\u53ef\u80fd\u662f\u5b57\u7b26\u4e32\u4e3a\u7a7a\uff0c\u6216\u957f\u5ea6\u4e0d\u8db31<br \/>\n\t<strong>ClientAbortException: java.io.IOException\u5f02\u5e38<\/strong><br \/>\n\t\u539f\u56e0\u662f\u7531\u4e8e\u670d\u52a1\u5668\u6b63\u5728\u5904\u7406http\u8bf7\u6c42\uff0c\u6b63\u5728\u8f93\u51fa\u5185\u5bb9\u65f6\uff0c\u7528\u6237\u5173\u95ed\u4e86\u6d4f\u89c8\u5668\uff0c\u9020\u6210\u4e86ClientAbortException\u5f02\u5e38\u3002\u5b83\u5c5e\u4e8eI\/O\u5f02\u5e38\u4e2d\u6bd4\u8f83\u5e38\u89c1\u7684\u4e00\u79cd\u3002<br \/>\n\t<strong>ClientAbortException &nbsp;Caused by: java.net.SocketException: Connection reset by peer: socket write error<\/strong><br \/>\n\t\u8fd9\u79cd\u5f02\u5e38\u5df2\u6bd4\u8f83\u5e38\u89c1\uff0c\u901a\u5e38\u6709\u4ee5\u4e0b\u51e0\u79cd\u60c5\u51b5\uff1a<br \/>\n\t\u670d\u52a1\u5668\u7684\u5e76\u53d1\u8fde\u63a5\u6570\u8d85\u8fc7\u4e86\u5176\u627f\u8f7d\u91cf\uff0c\u670d\u52a1\u5668\u4f1a\u5c06\u5176\u4e2d\u4e00\u4e9b\u8fde\u63a5Down\u6389;\u5ba2\u6237\u5173\u6389\u4e86\u6d4f\u89c8\u5668\uff0c\u800c\u670d\u52a1\u5668\u8fd8\u5728\u7ed9\u5ba2\u6237\u7aef\u53d1\u9001\u6570\u636e<br \/>\n\t<strong>java.lang.NullPointerException\u7a7a\u6307\u9488\u5f02\u5e38<\/strong><br \/>\n\t\u51fa\u73b0\u8be5\u5f02\u5e38\u7684\u539f\u56e0\u5728\u4e8e\u67d0\u4e2a\u5f15\u7528\u4e3anull\uff0c\u4f46\u5374\u8c03\u7528\u4e86\u5b83\u7684\u67d0\u4e2a\u65b9\u6cd5\uff0c\u8fd9\u65f6\u5c31\u4f1a\u51fa\u73b0\u8be5\u5f02\u5e38<br \/>\n\t<strong>ClassCastException<\/strong><br \/>\n\t\u7c7b\u578b\u5f3a\u5236\u8f6c\u6362\u5f02\u5e38,\u4f8b\u5982\uff1aObject x = new Integer(0);System.out.println((String)x);<br \/>\n\t<strong>IllegalArgumentException<\/strong><br \/>\n\t\u4f20\u9012\u975e\u6cd5\u53c2\u6570\u5f02\u5e38,\u6b64\u5f02\u5e38\u8868\u660e\u5411\u65b9\u6cd5\u4f20\u9012\u4e86\u4e00\u4e2a\u4e0d\u5408\u6cd5\u6216\u4e0d\u6b63\u786e\u7684\u53c2\u6570\u3002\u4f60\u770b\u770b\u4f20\u503c\u7684\u65b9\u6cd5\u662f\u5426\u53c2\u6570\u4e0d\u6b63\u786e<br \/>\n\t<strong>ArrayStoreException<\/strong><br \/>\n\t\u5411\u6570\u7ec4\u4e2d\u5b58\u653e\u4e0e\u58f0\u660e\u7c7b\u578b\u4e0d\u517c\u5bb9\u5bf9\u8c61\u5f02\u5e38,\u4f8b\u5982\uff1aObject x[] = new String[3];x[0] = new Integer(0);<br \/>\n\t<strong>NegativeArraySizeException<\/strong><br \/>\n\t\u521b\u5efa\u4e00\u4e2a\u5927\u5c0f\u4e3a\u8d1f\u6570\u7684\u6570\u7ec4\u9519\u8bef\u5f02\u5e38,\u4f8b\u5982int[] arr = new int[10];int i = arr[-1];<br \/>\n\tNumberFormatException<br \/>\n\t\u6570\u5b57\u683c\u5f0f\u5f02\u5e38,\u4f8b\u5982:\u628a&quot;176\/\/240&quot;\u8fd9\u4e2a\u8f93\u5165\u5b57\u6761\u8f6c\u6362\u4e3a\u4e00\u4e2a\u6570\u5b57<br \/>\n\t<strong>SecurityException<\/strong><br \/>\n\t\u5b89\u5168\u5f02\u5e38,\u4f8b\u5982:android\u7684\u6743\u9650\u5f02\u5e38\uff0c\u8fd0\u884cjava\u7684\u7a0b\u5e8f\u63d0\u793aMissing requited Permissions manifest attribute in main jar\u7b49<br \/>\n\t<strong>UnsupportedOperationException<\/strong><br \/>\n\t\u4e0d\u652f\u6301\u7684\u64cd\u4f5c\u5f02\u5e38,\u4f8b\u5982String testStr = &quot;100,300,400,545,666&quot;;List&lt;String&gt; test = Arrays.asList(testStr.split(&quot;,&quot;));test.remove(&quot;100&quot;);\u4f7f\u7528Arrays.asList()\u65b9\u6cd5\u4e00\u5b9a\u8981\u6ce8\u610f\u7c7b\u578b\u7684\u8f6c\u6362\u3002<\/span><br \/>\n\t<span style=\"color:#000080\"><span style=\"font-family:lucida sans unicode,lucida grande,sans-serif\">Java\u4e2d\u7684\u5f02\u5e38\u5206\u4e3a\u4e24\u5927\u7c7b\uff1a<br \/>\n\t\u3000\u30001.Checked Exception\uff08\u975eRuntime Exception\uff09<br \/>\n\t\u3000\u30002.Unchecked Exception\uff08Runtime Exception\uff09<\/span><\/span>\n<\/p>\n<p>\n\t<span style=\"color:#000080\"><span style=\"font-family:lucida sans unicode,lucida grande,sans-serif\">\u8fd0\u884c\u65f6\u5f02\u5e38<br \/>\n\t\u3000\u3000RuntimeException\u7c7b\u662fException\u7c7b\u7684\u5b50\u7c7b\uff0c\u5b83\u53eb\u505a\u8fd0\u884c\u65f6\u5f02\u5e38\uff0cJava\u4e2d\u7684\u6240\u6709\u8fd0\u884c\u65f6\u5f02\u5e38\u90fd\u4f1a\u76f4\u63a5\u6216\u8005\u95f4\u63a5\u5730\u7ee7\u627f\u81eaRuntimeException\u7c7b\u3002<br \/>\n\t\u3000\u3000Java\u4e2d\u51e1\u662f\u7ee7\u627f\u81eaException\uff0c\u800c\u4e0d\u7ee7\u627f\u81eaRuntimeException\u7c7b\u7684\u5f02\u5e38\u90fd\u662f\u975e\u8fd0\u884c\u65f6\u5f02\u5e38<\/span><\/span>\u3002\u9644\u4e00\u5f20java\u5f02\u5e38\u673a\u5236\u56fe:\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"java\u5f02\u5e38\u673a\u5236\" src=\"http:\/\/img.my.csdn.net\/uploads\/201211\/27\/1354020417_5176.jpg\" \/>\n<\/p>\n<p>\n\t<strong>\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3a\u535a\u4e3b\u539f\u521b\u6587\u7ae0\uff0c\u672a\u7ecf\u535a\u4e3b\u5141\u8bb8\u4e0d\u5f97\u8f6c\u8f7d\u3002<\/strong><\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=522\">Java\u5e38\u89c1\u768412\u5927\u5f02\u5e38\u548c\u89e3\u51b3\u529e\u6cd5<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u544a\u8bc9\u4f60\u4ec0\u4e48\u662f\u7ecf\u9a8c\uff0c\u7ecf\u9a8c\u5c31\u662f\u8fd9\u4e9b\u4e1c\u897f\u6211\u90fd\u7ecf\u5386\u8fc7\uff0c\u5e76\u4e14\u5f97\u5230\u4e86\u6211\u7684\u9a8c\u8bc1\uff01\u6700\u8fd1\u6709\u7f51\u53cb\u95ee\u6211ClientAbortExce [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[268,265,266,267],"class_list":["post-522","post","type-post","status-publish","format-standard","hentry","category-java","tag-classcastexception","tag-clientabortexception","tag-java","tag-nullpointerexception"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=522"}],"version-history":[{"count":5,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/522\/revisions"}],"predecessor-version":[{"id":767,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/522\/revisions\/767"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}