-
-
Notifications
You must be signed in to change notification settings - Fork 9k
Open
Description
简要描述
升级到4.8后用httpclient5 NPE了。
模块版本情况
- WxJava 模块名: weixin-java-mp-4.8.0
@Override
public void initHttp() {
WxMpConfigStorage configStorage = this.getWxMpConfigStorage();
HttpComponentsClientBuilder apacheHttpClientBuilder = DefaultHttpComponentsClientBuilder.get();
apacheHttpClientBuilder.httpProxyHost(configStorage.getHttpProxyHost())
.httpProxyPort(configStorage.getHttpProxyPort())
.httpProxyUsername(configStorage.getHttpProxyUsername())
.httpProxyPassword(configStorage.getHttpProxyPassword().toCharArray());
if (configStorage.getHttpProxyHost() != null && configStorage.getHttpProxyPort() > 0) {
this.httpProxy = new HttpHost(configStorage.getHttpProxyHost(), configStorage.getHttpProxyPort());
}
this.httpClient = apacheHttpClientBuilder.build();
}具体的类:WxMpServiceHttpComponentsImpl
NPE具体的行: configStorage.getHttpProxyPassword().toCharArray()这里的toCharArray()会NPE。
第一次使用这个类库,我也不确定是真的NPE还是我的使用方式不对,麻烦大佬看下。
Copilot
Metadata
Metadata
Assignees
Labels
No labels