Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1416

CachingHttpClientBuilder.create().build() throws NPE with default configuration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.3 Final
    • 4.3.2
    • HttpCache
    • None

    Description

      On build CachingHttpClientBuilder ends up calling CachingHttpClientBuilder.decorateMainExec which passes a null CacheConfig to the BasicHttpCacheStorage constructor causing a NPE.

      java.lang.NullPointerException
      at org.apache.http.impl.client.cache.BasicHttpCacheStorage.<init>(BasicHttpCacheStorage.java:53)
      at org.apache.http.impl.client.cache.CachingHttpClientBuilder.decorateMainExec(CachingHttpClientBuilder.java:110)
      at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:780)

      **Relevant code from CachingHttpClientBuilder.decorateMainExec
      final CacheConfig config = this.cacheConfig != null ? this.cacheConfig : CacheConfig.DEFAULT;
      .
      .
      .
      storage = new BasicHttpCacheStorage(cacheConfig);

      Attachments

        Activity

          People

            Unassigned Unassigned
            kyle_leonhard kyle leonhard
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: