Jonathan Yan created HTTPCLIENT-2410:
----------------------------------------

             Summary: NullPointerException when building HttpClient with 
evictExpiredConnections
                 Key: HTTPCLIENT-2410
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2410
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient (async), HttpClient (classic)
    Affects Versions: 5.6
            Reporter: Jonathan Yan
         Attachments: Issue.java

When calling the {{build()}} method on an instance of 
{{{{{}HttpClient{}}}Builder}} configured with {{evictExpiredConnections}} but 
not {{{}evictIdleConnections{}}}, a {{NullPointerException}} is thrown. Here is 
an example stacktrace:
{code:java}
Exception in thread "main" java.lang.NullPointerException: Cannot invoke 
"org.apache.hc.core5.util.TimeValue.divide(long, 
java.util.concurrent.TimeUnit)" because "this.maxIdleTime" is null
    at 
org.apache.hc.client5.http.impl.classic.HttpClientBuilder.build(HttpClientBuilder.java:1118)
    at Issue.main(Issue.java:7){code}
The issue can be reproduced with the attached file using 
{{{}org.apache.httpcomponents.client5:httpclient5:5.6{}}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to