TrustStrategy——Java中httpclient.jar和httpcore.jar版本差異帶來的異常
來源:http://blog.csdn.net/loongshawn/article/details/50590660
前言說明:當前我的工程中使用的httpclient-4.3.6.jar和httpcore-4.3.3.jar版本的包。
<code class="language-java hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;"><dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore</artifactId> <version><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">4.3</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">.3</span></version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">4.3</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">.6</span></version> </dependency> </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li></ul>
今天執行阿里雲的OSS相關操作時,首先提示以下異常:
<code class="language-java hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">java.lang.ClassNotFoundException: org.apache.http.ssl.TrustStrategy</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>
詳細如下:
<code class="language-java hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">Exception in thread <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"main"</span> java.lang.NoClassDefFoundError: org/apache/http/ssl/TrustStrategy at com.aliyun.oss.OSSClient.<init>(OSSClient.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">246</span>) at com.aliyun.oss.OSSClient.<init>(OSSClient.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">206</span>) at com.autonavi.oss.client.DefaultOSSClient.<clinit>(DefaultOSSClient.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">12</span>) at com.autonavi.oss.put.Upload.put(Upload.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">20</span>) at com.autonavi.oss.put.Upload.main(Upload.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">58</span>) Caused by: java.lang.ClassNotFoundException: org.apache.http.ssl.TrustStrategy at java.net.URLClassLoader$<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1.</span>run(URLClassLoader.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">366</span>) at java.net.URLClassLoader$<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1.</span>run(URLClassLoader.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">355</span>) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">354</span>) at java.lang.ClassLoader.loadClass(ClassLoader.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">425</span>) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">308</span>) at java.lang.ClassLoader.loadClass(ClassLoader.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">358</span>) ... <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">5</span> more </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li></ul>
從上面報錯提示可以看出,是org/apache/http/ssl/TrustStrategy下面找不到TrustStrategy這個類,我查了下依賴中的httpclient-4.3.6.jar和httpcore-4.3.3.jar兩個包,均沒有這個類。
而4.4版本中有ssl路徑:
及對應org/apache/http/ssl/TrustStrategy方法。
很明顯是版本不對,應該換成新版本。
<code class="language-java hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;"><dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore</artifactId> <version><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">4.4</span></version> </dependency> </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li></ul>
重新執行程式碼,上面異常已經消失,不過出現新異常:
<code class="language-java hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">java.lang.NoClassDefFoundError: org/apache/http/conn/ssl/NoopHostnameVerifier</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>
異常詳細:
<code class="language-java hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">Exception in thread <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"main"</span> java.lang.NoClassDefFoundError: org/apache/http/conn/ssl/NoopHostnameVerifier at com.aliyun.oss.common.comm.DefaultServiceClient.createHttpClientConnectionManager(DefaultServiceClient.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">230</span>) at com.aliyun.oss.common.comm.DefaultServiceClient.<init>(DefaultServiceClient.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">78</span>) at com.aliyun.oss.OSSClient.<init>(OSSClient.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">246</span>) at com.aliyun.oss.OSSClient.<init>(OSSClient.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">206</span>) at com.autonavi.oss.client.DefaultOSSClient.<clinit>(DefaultOSSClient.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">12</span>) at com.autonavi.oss.put.Upload.put(Upload.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">20</span>) at com.autonavi.oss.put.Upload.main(Upload.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">58</span>) Caused by: java.lang.ClassNotFoundException: org.apache.http.conn.ssl.NoopHostnameVerifier at java.net.URLClassLoader$<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1.</span>run(URLClassLoader.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">366</span>) at java.net.URLClassLoader$<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1.</span>run(URLClassLoader.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">355</span>) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">354</span>) at java.lang.ClassLoader.loadClass(ClassLoader.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">425</span>) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">308</span>) at java.lang.ClassLoader.loadClass(ClassLoader.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">358</span>) ... <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7</span> more</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li></ul>
很明顯是版本不對,是由於httpclient-4.3.6.jar缺少NoopHostnameVerifier方法:
而4.4版本中有這個方法:
應該換成新版本,即換成httpclient-4.4.jar
<code class="language-java hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;"><dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">4.4</span></version> </dependency> </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li></ul>
檢視下jar包中相應路徑存在上面那個類。
最後再次執行,執行成功,無異常!
所以,下次碰到以下兩個異常時:
1、
<code class="language-java hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">java.lang.ClassNotFoundException: org.apache.http.ssl.TrustStrategy</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>
2、
<code class="language-java hljs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">java.lang.NoClassDefFoundError: org/apache/http/conn/ssl/NoopHostnameVerifier</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>
需要升級httpclient.jar和httpcore.jar兩個包的版本,4.3的版本中不含有上述兩個類,需要同時升級到4.4版本。
即替換為httpclient-4.4.jar和httpcore-4.4.jar
相關文章
- jquery版本中的差異jQuery
- ERP差異來源和差異處理
- Java checked異常和unchecked異常。Java
- Java 中的異常Java
- java中的異常Java
- ChromeDriver版本差異Chrome
- Java異常的中斷和恢復Java
- Java版本功能差異一覽指南 - marcobehlerJava
- Oracle中exists和in的效能差異Oracle
- 關於HTTP /1.1 與 /2.0版本的常見差異和特性HTTP
- 異常和中斷
- Java中異常處理和設計Java
- 小心異常(Exception)帶來的風險(2) (轉)Exception
- Java和C++的基本差異(轉)JavaC++
- Java 異常(二) 自定義異常Java
- JAVA異常和日誌Java
- 異常和異常呼叫鏈
- 淺析Java語言中兩種異常的差別Java
- Java異常Java
- Java 異常Java
- 異常JavaJava
- 【java】異常Java
- java 異常Java
- 異常-編譯期異常和執行期異常的區別編譯
- 如何分析因為 SAP UI5 版本差異帶來的問題試讀版UI
- UDP和TCP的差異UDPTCP
- vue和react的差異VueReact
- Java中異常分類和Throw和Throws的區別Java
- 從原始碼分析JSONObject因版本差異導致toString格式異常問題原始碼JSONObject
- Java 異常表與異常處理原理Java
- 聊聊Java中的異常(基礎篇)Java
- Java 中的異常處理機制Java
- java之JAVA異常Java
- java之異常Java
- Java異常十一:使用throw丟擲異常物件;throw和throws的區別Java物件
- angular-resource版本差異問題Angular
- jmu-Java-06異常-01-常見異常Java
- Java中Error和Exception的異同以及執行時異常(Runtime exception)與檢查型異常(checked exception)的區別JavaErrorException