NPE with httpclient 4.4
See original GitHub issueCaused by: java.lang.NullPointerException
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper.ensureLoaded(ByteSourceJsonBootstrapper.java:489)
at com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper.detectEncoding(ByteSourceJsonBootstrapper.java:126)
at com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper.constructParser(ByteSourceJsonBootstrapper.java:215)
at com.fasterxml.jackson.core.JsonFactory._createParser(JsonFactory.java:1191)
at com.fasterxml.jackson.core.JsonFactory.createParser(JsonFactory.java:753)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2207)
at org.ektorp.impl.StdCouchDbConnector$5.success(StdCouchDbConnector.java:250)
at org.ektorp.http.RestTemplate.handleResponse(RestTemplate.java:122)
at org.ektorp.http.RestTemplate.get(RestTemplate.java:22)
at org.ektorp.impl.StdCouchDbConnector.get(StdCouchDbConnector.java:246)
at org.ektorp.impl.StdCouchDbConnector.get(StdCouchDbConnector.java:237)
at org.ektorp.support.StdDesignDocumentFactory.getFromDatabase(StdDesignDocumentFactory.java:57)
at org.ektorp.support.CouchDbRepositorySupport.initDesignDocInternal(CouchDbRepositorySupport.java:280)
at org.ektorp.support.CouchDbRepositorySupport.initStandardDesignDocument(CouchDbRepositorySupport.java:274)
This exception is thrown after upgrading httpclient from 4.3.6 to 4.4 (using Java8u31 and ektorp 1.4.2).
I reverted for now but wanted to inform you about this problem.
Issue Analytics
- State:
- Created 9 years ago
- Comments:25 (10 by maintainers)
Top Results From Across the Web
HttpClient 4.5.X release notes - Apache Distribution
HttpClient 4.5.5 (GA) is a maintenance release that fixes a regression introduced by the previous release causing a NPE in SystemDefaultCredentialsProvider.
Read more >Cookies getting ignored in Apache httpclient 4.4 - java
I have executed the example code with both versions 4.3.6 and 4.5 . With 4.3.6 I used RequestConfig.DEFAULT and it was working fine....
Read more >[jira] [Commented] (HTTPCORE-530) NullPointerException in ...
filterHeader(BasicListHeaderIterator.java:130) ~[Apache-HttpComponents-HttpCore-4.4.x.jar:?] at org.apache.http.message.
Read more >ThreadingBehavior (Apache HttpCore 4.4.6 API) - Javadoc.io
... Throws: IllegalArgumentException - if this enum type has no constant with the specified name: NullPointerException - if the argument is null.
Read more >org.apache.httpcomponents : httpclient : 4.4.1 - Maven Central
Apache HttpClient - Apache HttpComponents Client. ... org.apache.httpcomponents:httpclient 4.4.1. content_copy. <?xml version="1.0" encoding="UTF-8"?> <!
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I ran into this when I upgraded Spring Boot 1.5 -> 2.0. It caused an upgrade of Jackson, which in turn forced me to upgrade to Ektorp 1.5, after which my “all”-views for designs stopped working with similar stack traces as @huxi above.
Solved it by disabling StdHttpClient.caching using Java configuration of Spring Boot, something like:
Thanks @maratynsky !
As of HttpClient-Cache 4.4+
HEAD
requests will be cached. This seems to break in cases where theHEAD
request comes first before any subsequentGET
requests on the same target. In other words: if you can usehttpclient-cache:4.3.x
in your setup, you should be able to work around that issue. Details/demo see https://github.com/gesellix/httpclient-cache-demo. I’ve already started a discussion about that issue at the httpclient-users mailing list: https://lists.apache.org/thread.html/8cb4252482565e0f6d59b097320cfbf572c212508b63e9fc59a2e1b4@<httpclient-users.hc.apache.org> - feel free to join.