重要:工程运行环境由jdk1.7调整为jdk1.6
This commit is contained in:
+6
-2
@@ -94,8 +94,12 @@ public abstract class HttpClientFactory {
|
||||
new X509TrustManager[] { createX509TrustManager() },
|
||||
new java.security.SecureRandom());
|
||||
return sslContext;
|
||||
} catch (NoSuchAlgorithmException | KeyManagementException e) {
|
||||
throw new HttpClientException("Create SSLContext Error:", e);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new HttpClientException(
|
||||
"Create SSLContext NoSuchAlgorithmException:", e);
|
||||
} catch (KeyManagementException e) {
|
||||
throw new HttpClientException(
|
||||
"Create SSLContext KeyManagementException:", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
-4
@@ -108,10 +108,18 @@ public class Netty4HttpClient extends AbstractHttpClient {
|
||||
.addListener(listener);
|
||||
response = future.get();
|
||||
handleResponse(response);
|
||||
} catch (IOException | InterruptedException | ExecutionException e) {
|
||||
} catch (IOException e) {
|
||||
throw new HttpClientException("I/O error on "
|
||||
+ request.getMethod().name() + " request for \""
|
||||
+ request.getURI().toString() + "\":" + e.getMessage(), e);
|
||||
} catch (InterruptedException e) {
|
||||
throw new HttpClientException("Execute error on "
|
||||
+ request.getMethod().name() + " request for \""
|
||||
+ request.getURI().toString() + "\":" + e.getMessage(), e);
|
||||
} catch (ExecutionException e) {
|
||||
throw new HttpClientException("Execute error on "
|
||||
+ request.getMethod().name() + " request for \""
|
||||
+ request.getURI().toString() + "\":" + e.getMessage(), e);
|
||||
} finally {
|
||||
if (response != null) {
|
||||
response.close();
|
||||
@@ -135,9 +143,9 @@ public class Netty4HttpClient extends AbstractHttpClient {
|
||||
HttpEntity entity = request.getEntity();
|
||||
if (entity != null) {
|
||||
ByteBuf byteBuf = ByteBufAllocator.DEFAULT.buffer();
|
||||
try (ByteBufOutputStream out = new ByteBufOutputStream(byteBuf)) {
|
||||
entity.writeTo(out);
|
||||
}
|
||||
ByteBufOutputStream out = new ByteBufOutputStream(byteBuf);
|
||||
entity.writeTo(out);
|
||||
out.close();
|
||||
uriRequest = new DefaultFullHttpRequest(
|
||||
uriRequest.getProtocolVersion(), uriRequest.getMethod(),
|
||||
uriRequest.getUri(), byteBuf);
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.foxinmy.weixin4j.tuple;
|
||||
|
||||
import java.beans.Transient;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/**
|
||||
* 消息元件
|
||||
@@ -21,7 +20,6 @@ public interface Tuple extends Serializable {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Transient
|
||||
@JSONField(deserialize = false, serialize = false)
|
||||
@XmlTransient
|
||||
public String getMessageType();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.foxinmy.weixin4j.util;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Iterator;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.foxinmy.weixin4j.model.Consts;
|
||||
|
||||
@@ -159,8 +158,7 @@ public final class StringUtil {
|
||||
}
|
||||
final Object first = iterator.next();
|
||||
if (!iterator.hasNext()) {
|
||||
String result = Objects.toString(first);
|
||||
return result;
|
||||
return String.valueOf(first);
|
||||
}
|
||||
|
||||
// two or more elements
|
||||
|
||||
Reference in New Issue
Block a user