报错异常:

背景:
esUtils在common服务中、启动media服务时候、报这个异常、后排查esUtils在启动时候发生异常引起的、在相关bean中加入try{}catch{}即可解决问题
String[] split = url.split(",");
HttpHost[] httpHosts = new HttpHost[split.length];
try{
if(split.length>0){
for (int i = 0; i < split.length; i++) {
String s = split[i];
String[] split1 = s.split(":");
HttpHost http = new HttpHost(split1[0], Integer.parseInt(split1[1]), "http");
httpHosts[i] = http;
}
CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY,
new UsernamePasswordCredentials(username, password));
RestClient httpClient = RestClient.builder(httpHosts)
.setHttpClientConfigCallback(
(HttpAsyncClientBuilder httpAsyncClientBuilder) -> httpAsyncClientBuilder.setDefaultCredentialsProvider(
credentialsProvider))
.build();
client = new RestHighLevelClientBuilder(httpClient)
.setApiCompatibilityMode(true)
.build();
}
}catch (Exception e){
e.printStackTrace();
}

















