2

java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED当我尝试使用 Https 请求时,我得到了closeableHttpClient.execute(request, null)

java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED
    at org.apache.http.util.Asserts.check(Asserts.java:46)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRunning(CloseableHttpAsyncClientBase.java:90)
    at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:123)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:75)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:108)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:92)

下面是导致异常的方法

public Optional<HttpResponse> execute(HttpUriRequest request, CloseableHttpAsyncClient closeableHttpAsyncClient, long timeout) {       
        HttpResponse response = null;
        try {            
            final Future<HttpResponse> future = closeableHttpAsyncClient.execute(request, null); // Throwing IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED`
            response = future.get(timeout, TimeUnit.SECONDS);            
        } catch (InterruptedException | ExecutionException | TimeoutException e) {
            request.abort();
            LOGGER.log(Level.ERROR, "Exception occured while getting Future response", e);
            throw new RuntimeException(e);
        } catch (Exception e) {
            LOGGER.log(Level.ERROR, "Unknown exception occured ", e);
            throw new RuntimeException(e);
        }        
        return Optional.ofNullable(response);
    }

下面是我的ApacheAsyncClient初始化方法

@PostConstruct
private void initializeApacheAsyncClient() throws IOReactorException {

    IOReactorConfig ioReactorConfig = IOReactorConfig.custom()
            .setIoThreadCount(Runtime.getRuntime().availableProcessors()).setConnectTimeout(10000)
            .setSoTimeout(30000).build();
    ConnectingIOReactor ioReactor = new DefaultConnectingIOReactor(ioReactorConfig);

    Registry<SchemeIOSessionStrategy> sessionStrategyRegistry = RegistryBuilder.<SchemeIOSessionStrategy> create()
            .register("http", NoopIOSessionStrategy.INSTANCE)
            .register("https", new SSLIOSessionStrategy(customSSLContext.getSSLContext())).build();

    PoolingNHttpClientConnectionManager connectionManager = new PoolingNHttpClientConnectionManager(ioReactor,
            sessionStrategyRegistry);
    connectionManager.setDefaultMaxPerRoute(400);
    connectionManager.setMaxTotal(400);

    RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(10 * 1000).setSocketTimeout(60 * 1000)
    .setConnectionRequestTimeout(30 * 1000).build();

    httpAsyncClient = HttpAsyncClients.custom().setConnectionManager(connectionManager).setDefaultRequestConfig(requestConfig)
            .setSSLContext(customSSLContext.getSSLContext()).build();

    httpAsyncClient.start();
    LOGGER.log(Level.INFO, "Initialize ApacheAsyncClient is successful");
    // detect idle and expired connections and close them
    IdleConnectionEvictor staleMonitor = new IdleConnectionEvictor(connectionManager, 30);
    staleMonitor.start();

}

下面是我的IdleConnectionEvictor

public class IdleConnectionEvictor extends Thread {
    private static final Logger          LOGGER = Logger.getInstance(IdleConnectionEvictor.class);
    ReentrantLock                        lock   = new ReentrantLock();
    private NHttpClientConnectionManager nioConnMgr;

    private int                          httpClientIdleConnectionEvictionFrequency;
    private int                          nHttpClientIdleConnectionEvictionFrequency;
    private volatile boolean             shutdown;

    public IdleConnectionEvictor(NHttpClientConnectionManager nioConnMgr,
            int nHttpClientIdleConnectionEvictionFrequency) {
        super();
        this.nioConnMgr = nioConnMgr;
        this.nHttpClientIdleConnectionEvictionFrequency = nHttpClientIdleConnectionEvictionFrequency;    
    }

    @Override
    public void run() {

        try {
            Thread.sleep(30 * 1000L);
            boolean isLockAcquired = lock.tryLock(1, TimeUnit.SECONDS);
            if (!isLockAcquired)
                LOGGER.log(Level.ERROR, "Couldnt acquire lock in 1 second to recycle Stale Http connections");
            while (!shutdown && isLockAcquired && !Thread.currentThread().interrupted()) {


                Optional.ofNullable(nioConnMgr).ifPresent(NHttpClientConnectionManager::closeExpiredConnections);
                Optional.ofNullable(nioConnMgr).ifPresent(connManager -> connManager
                        .closeIdleConnections(nHttpClientIdleConnectionEvictionFrequency, TimeUnit.SECONDS));
                Optional.ofNullable(nioConnMgr).ifPresent(connManager -> LOGGER.log(Level.DEBUG,
                        "Closed ExpiredConnections and IdleConnections for Apache Async Http Client"));

            }

        } catch (InterruptedException ex) {
            LOGGER.log(Level.ERROR, "InterruptedException while recycling Stale Http connections ", ex);
        } finally {
            lock.unlock();
        }

    }

    public void shutdown() {
        shutdown = true;
        synchronized (this) {
            notifyAll();
        }
    }

}

更新 下面是调试日志,我注意到 Reactor 在发出第一个请求后正在关闭

[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.client.MainClientExec | testuser@abc.com | fId4CKOQDAR1 | [exchange: 1] start execution
[Jun 01 16:57:53] DEBUG | org.apache.http.client.protocol.RequestAddCookies | testuser@abc.com | fId4CKOQDAR1 | CookieSpec selected: default
[Jun 01 16:57:53] DEBUG | org.apache.http.client.protocol.RequestAuthCache | testuser@abc.com | fId4CKOQDAR1 | Auth cache not set in the context
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.client.InternalHttpAsyncClient | testuser@abc.com | fId4CKOQDAR1 | [exchange: 1] Request connection for {s}->https://testapp.dev.com:8443
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.client.InternalHttpAsyncClient |  |  | [exchange: 1] Connection allocated: CPoolProxy{http-outgoing-0 [ACTIVE]}
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][r:]: Set attribute http.nio.exchange-handler
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][rw:]: Event set [w]
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][rw:]: Set timeout 30000
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.client.InternalIODispatch |  |  | http-outgoing-0 [ACTIVE]: Connected
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][rw:]: Set attribute http.nio.http-exchange-state
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.client.InternalHttpAsyncClient |  |  | [exchange: 1] Start connection routing
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 Upgrade session 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][rw:][ACTIVE][rw][NEED_UNWRAP][0][0][268]
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.client.InternalHttpAsyncClient |  |  | [exchange: 1] route completed
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.client.MainClientExec |  |  | [exchange: 1] Connection route established
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.client.MainClientExec |  |  | [exchange: 1] Attempt 1 to execute request
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.client.MainClientExec |  |  | [exchange: 1] Target auth state: UNCHALLENGED
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.client.MainClientExec |  |  | [exchange: 1] Proxy auth state: UNCHALLENGED
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][rw:][ACTIVE][rw][NEED_UNWRAP][0][0][268]: Set timeout 240000
[Jun 01 16:57:53] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 >> POST /Reports/show.json?name=invoiceReport HTTP/1.1
[Jun 01 16:57:53] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 >> Content-Encoding: UTF-8
[Jun 01 16:57:53] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 >> X-Remote-Identifier: testuser@abc.com
[Jun 01 16:57:53] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 >> Transfer-Encoding: chunked
[Jun 01 16:57:53] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 >> Content-Type: text/json
[Jun 01 16:57:53] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 >> Host: testapp.dev.com:8443
[Jun 01 16:57:53] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 >> Connection: Keep-Alive
[Jun 01 16:57:53] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 >> User-Agent: Apache-HttpAsyncClient/4.1.4 (Java/1.8.0_144)
[Jun 01 16:57:53] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][rw:][ACTIVE][rw][NEED_UNWRAP][0][0][268]: Event set [w]
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.InternalIODispatch |  |  | http-outgoing-0 [ACTIVE] Output ready
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.MainClientExec |  |  | [exchange: 1] produce content
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.InternalIODispatch |  |  | http-outgoing-0 [ACTIVE] [chunk-coded; completed: false]
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][rw:w][ACTIVE][rw][NOT_HANDSHAKING][0][0][101]: 0 bytes written
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.InternalIODispatch |  |  | http-outgoing-0 [ACTIVE] Output ready
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.MainClientExec |  |  | [exchange: 1] produce content
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.MainClientExec |  |  | [exchange: 1] Request completed
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.InternalIODispatch |  |  | http-outgoing-0 [ACTIVE] [chunk-coded; completed: true]
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][rw:w][ACTIVE][rw][NOT_HANDSHAKING][0][0][677]: 605 bytes written
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 >> "POST /Reports/show.json?name=invoiceReport HTTP/1.1[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 >> "Content-Encoding: UTF-8[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 >> "X-Remote-Identifier: testuser@abc.com[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 >> "Transfer-Encoding: chunked[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 >> "Content-Type: text/json[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 >> "Host: testapp.dev.com:8443[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 >> "User-Agent: Apache-HttpAsyncClient/4.1.4 (Java/1.8.0_144)[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 >> "[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 >> "57[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 >> "{"page":{"pageNumber":"1","sortInfo":null,"pageSize":"0","isSinglePageResult":"false"}}[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 >> "0[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 >> "[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.InternalIODispatch |  |  | http-outgoing-0 [ACTIVE] Request ready
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][r:w][ACTIVE][r][NOT_HANDSHAKING][0][0][0]: Event cleared [w]
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][r:r][ACTIVE][r][NOT_HANDSHAKING][0][0][0]: 650 bytes read
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 << "Server: Apache-Coyote/1.1[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 << "X-FRAME-OPTIONS: SAMEORIGIN[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 << "Set-Cookie: JSESSIONID=B92360DCA41FC07D29846B81BF984837; Path=/Reports; HttpOnly[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 << "Content-Type: application/json;charset=UTF-8[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 << "Content-Language: en-US[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 << "Transfer-Encoding: chunked[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 << "Date: Mon, 01 Jun 2020 21:57:54 GMT[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 << "[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 << "15a[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 << "{"screen":"Invoice Report","cacheable":false,"page":{"totalRecords":0,"pageNumber":1,"list":[],"version":1.0}[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 << "0[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 << HTTP/1.1 200 OK
[Jun 01 16:57:54] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 << Server: Apache-Coyote/1.1
[Jun 01 16:57:54] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 << X-FRAME-OPTIONS: SAMEORIGIN
[Jun 01 16:57:54] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 << Set-Cookie: JSESSIONID=B92360DCA41FC07D29846B81BF984837; Path=/Reports; HttpOnly
[Jun 01 16:57:54] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 << Content-Type: application/json;charset=UTF-8
[Jun 01 16:57:54] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 << Content-Language: en-US
[Jun 01 16:57:54] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 << Transfer-Encoding: chunked
[Jun 01 16:57:54] DEBUG | org.apache.http.headers |  |  | http-outgoing-0 << Date: Mon, 01 Jun 2020 21:57:54 GMT
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.InternalIODispatch |  |  | http-outgoing-0 [ACTIVE(356)] Response received
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.MainClientExec |  |  | [exchange: 1] Response received HTTP/1.1 200 OK
[Jun 01 16:57:54] DEBUG | org.apache.http.client.protocol.ResponseProcessCookies |  |  | Cookie accepted [JSESSIONID="B92360DCA41FC07D29846B81BF984837", version:0, domain:testapp.dev.com, path:/Reports, expiry:null]
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.InternalIODispatch |  |  | http-outgoing-0 [ACTIVE(356)] Input ready
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.MainClientExec |  |  | [exchange: 1] Consume content
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][r:r][ACTIVE][r][NOT_HANDSHAKING][0][0][0]: 0 bytes read
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][r:r][ACTIVE][r][NOT_HANDSHAKING][0][0][0]: 0 bytes read
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][r:r][ACTIVE][r][NOT_HANDSHAKING][0][0][0]: 0 bytes read
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][r:r][ACTIVE][r][NOT_HANDSHAKING][0][0][0]: 0 bytes read
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.InternalIODispatch |  |  | http-outgoing-0 [ACTIVE] [chunk-coded; completed: false]
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.InternalIODispatch |  |  | http-outgoing-0 [ACTIVE] Input ready
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.MainClientExec |  |  | [exchange: 1] Consume content
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][r:r][ACTIVE][r][NOT_HANDSHAKING][0][0][0]: 2 bytes read
[Jun 01 16:57:54] DEBUG | org.apache.http.wire |  |  | http-outgoing-0 << "[\r][\n]"
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.InternalHttpAsyncClient |  |  | [exchange: 1] Connection can be kept alive indefinitely
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.MainClientExec |  |  | [exchange: 1] Response processed
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.InternalHttpAsyncClient |  |  | [exchange: 1] releasing connection
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][r:r][ACTIVE][r][NOT_HANDSHAKING][0][0][0]: Remove attribute http.nio.exchange-handler
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl |  |  | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][r:r][ACTIVE][r][NOT_HANDSHAKING][0][0][0]: Set timeout 0
[Jun 01 16:57:54] DEBUG | org.apache.http.impl.nio.client.InternalIODispatch |  |  | http-outgoing-0 [ACTIVE] [chunk-coded; completed: true]
[Jun 01 16:57:58] DEBUG | org.apache.http.impl.conn.DefaultManagedHttpClientConnection | testuser@abc.com | fId4CKOQDAR1 | http-outgoing-1: set socket timeout to 0
[Jun 01 16:57:58] DEBUG | org.apache.http.impl.execchain.MainClientExec | testuser@abc.com | fId4CKOQDAR1 | Cancelling request execution
[Jun 01 16:58:00] DEBUG | org.apache.http.impl.conn.DefaultManagedHttpClientConnection | testuser@abc.com | fId4CKOQDAR1 | http-outgoing-2: set socket timeout to 0
[Jun 01 16:58:00] DEBUG | org.apache.http.impl.execchain.MainClientExec | testuser@abc.com | fId4CKOQDAR1 | Cancelling request execution
[Jun 01 16:58:15] DEBUG | org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl | testuser@abc.com | fId4CKOQDAR1 | http-outgoing-0 11.11.11.11:58768<->10.10.10.10:8443[ACTIVE][r:r][ACTIVE][r][NOT_HANDSHAKING][0][0][0]: Close
[Jun 01 16:58:15] DEBUG | org.apache.http.impl.nio.client.InternalIODispatch |  |  | http-outgoing-0 [CLOSED]: Disconnected
[Jun 01 16:58:35] ERROR | com.apps.http.rest.impl.RestServiceAsync | testuser@abc.com | fId4CKOQDAR1 | Unknown exception occured 
java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED
    at org.apache.http.util.Asserts.check(Asserts.java:46)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRunning(CloseableHttpAsyncClientBase.java:90)
    at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:123)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:75)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:108)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:92)
    at com.apps.http.rest.impl.RestServiceAsync.execute(RestServiceAsync.java:73)
    at com.apps.http.rest.impl.RestServiceAsync.call(RestServiceAsync.java:42)

更新 1 使用4.1.5-Snapshotam 后出现以下错误

Caused by: java.util.concurrent.CancellationException: Request execution cancelled
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.execute(CloseableHttpAsyncClientBase.java:114)
    at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:138)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:75)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:108)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:92)       

有人可以帮我解决这个问题吗?

4

0 回答 0