Ektorp: NPE with httpclient 4.4
Caused 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.
About this issue
- Original URL
- State: open
- Created 9 years ago
- Comments: 25 (10 by maintainers)
Commits related to this issue
- added a test to reproduce the issue #222 (it fails as reported when using the StdHttpClient.Builder) + provided an ApacheHC configuration that make this test pass. The configuration is provided as a ... — committed to YannRobert/Ektorp by YannRobert 9 years ago
- Must use httpclient v4.3 If we use the latest version of httpclient, we hit the reported issue https://github.com/helun/Ektorp/issues/222 [#118453075] — committed to cloudfoundry/app-autoscaler by deleted user 8 years ago
- Fixed issue with Caching of the StdHttpClient.Builder https://github.com/helun/Ektorp/issues/222 — committed to D-M-Moriarty/CouchDB_CA by D-M-Moriarty 6 years ago
- Fix NPE in Ektorp's connector Newer versions of HttpClient have a changed caching behavior which seems to cause issues with Ektorps reponse handling in some cases. The `get` method is overriden to im... — committed to particify/arsnova-server by dgerhardt 4 years ago
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 !