Francois-Xavier Bonnet created HTTPCLIENT-1324:
--------------------------------------------------
Summary: CachingHttpClientBuilder.build() fails when
asynchronousWorkersMax=0
Key: HTTPCLIENT-1324
URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1324
Project: HttpComponents HttpClient
Issue Type: Bug
Components: Cache
Affects Versions: 4.3 Alpha1
Reporter: Francois-Xavier Bonnet
Priority: Minor
The following code throws an Exception:
CacheConfig cacheConfig =
CacheConfig.custom().setAsynchronousWorkersMax(0).build();
CachingHttpClientBuilder.create().setCacheConfig(cacheConfig).build();
java.lang.IllegalArgumentException
at
java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:826)
at
java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:717)
at
org.apache.http.impl.client.cache.AsynchronousValidator.<init>(AsynchronousValidator.java:74)
at
org.apache.http.impl.client.cache.CachingHttpClientBuilder.createAsynchronousRevalidator(CachingHttpClientBuilder.java:106)
at
org.apache.http.impl.client.cache.CachingHttpClientBuilder.decorateMainExec(CachingHttpClientBuilder.java:100)
at
org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:528)
According to the javadoc of method
org.apache.http.impl.client.cache.CacheConfig.Builder.setAsynchronousWorkersMax(int)
"a value of 0 disables background revalidations"
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]