JIRA客户端连续抛出远程主机异常强制关闭现有连接

时间:2019-01-30 06:07:07

标签: java jira-rest-api jira-rest-java-api

我收到一个错误消息,指出远程主机强行关闭了现有连接

完整堆栈跟踪:

java.io.IOException: An existing connection was forcibly closed by the remote host
    at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[na:1.8.0_102]
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) ~[na:1.8.0_102]
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_102]
    at sun.nio.ch.IOUtil.read(IOUtil.java:197) ~[na:1.8.0_102]
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) ~[na:1.8.0_102]
    at org.apache.http.nio.reactor.ssl.SSLIOSession.receiveEncryptedData(SSLIOSession.java:449) ~[atlassian-httpclient-plugin-0.23.0.jar:na]
    at org.apache.http.nio.reactor.ssl.SSLIOSession.isAppInputReady(SSLIOSession.java:503) ~[atlassian-httpclient-plugin-0.23.0.jar:na]
    at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:122) ~[atlassian-httpclient-plugin-0.23.0.jar:na]
    at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:164) [atlassian-httpclient-plugin-0.23.0.jar:na]
    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:339) [atlassian-httpclient-plugin-0.23.0.jar:na]
    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:317) [atlassian-httpclient-plugin-0.23.0.jar:na]
    at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:278) [atlassian-httpclient-plugin-0.23.0.jar:na]
    at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [atlassian-httpclient-plugin-0.23.0.jar:na]
    at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:590) [atlassian-httpclient-plugin-0.23.0.jar:na]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102] 

我已经提到了所有可能导致这种情况的原因,但无法查明我的案情的原因 An existing connection was forcibly closed by the remote host

public class JRC {
        public Issue getIssue(String issueKey) throws Exception {
            final URI jiraServerUri = new URI("domain/JIRA/");
            final JiraRestClient restClient = new AsynchronousJiraRestClientFactory()
                    .createWithBasicHttpAuthentication(jiraServerUri, "user", "password");
            Promise issuePromise = restClient.getIssueClient().getIssue(issueKey);
            return Optional.ofNullable((Issue) issuePromise.claim()).orElseThrow(() -> new Exception("No such issue"));
        }
}

0 个答案:

没有答案