You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Arturo Bernal (Jira)" <ji...@apache.org> on 2025/12/25 19:36:00 UTC

[jira] [Updated] (HTTPCLIENT-2410) NullPointerException when building HttpClient with evictExpiredConnections

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-2410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arturo Bernal updated HTTPCLIENT-2410:
--------------------------------------
    Fix Version/s: 5.6

> 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
>            Priority: Major
>             Fix For: 5.6
>
>         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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org