Posts

Showing posts with the label Error

Handle 409 conflict document in couchdb

Problem Use case:  CouchDB Error 409 conflict document. Exception Details [Truncated]: CouchDB is throwing error 409 conflict while calling REST API to update data. CouchDB will throw 409 conflict document exception if the payload is not proper. Following are some of the cases. "_id" : This attribute is present, but the "_rev" attribute is not present or is wrong. CouchDB uses both the "_id" and "_rev" attribute while updating a Document. Every time we update a document the "_rev" attribute value gets updated. Solution: If we want to update data, then make sure both "_id" and "_rev" attributes are carrying proper values respectively. Referance Links related to CouchDB: https://webdevpedia.blogspot.com/2019/07/installing-couchdb-on-gcp-compute-engine.html

CouchDB Error 412:Precondition Failed

Problem Use case:  CouchDB Error 412:Precondition Failed Exception Details [Truncated]: CouchDB is throwing error while calling REST API to update data. Solution: CouchDB will throw 412:Precondition Failed exception if the payload does not contain the unique identifier "_id" attribute or its value is missing. Check the payload for PUT or POST to make sure the "_id" attribute is not missing. Referance Links related to CouchDB: https://webdevpedia.blogspot.com/2019/07/installing-couchdb-on-gcp-compute-engine.html

Failed to instantiate [java.util.List]: Specified class is an interface in HTTP controller handler?

Problem Use case: Following SpringBoot Rest Controller is not able to map the request payload @Controller @RequestMapping("/api") public class BlogController { @RequestMapping(value = "/blogstories", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<List<BlogStoryObject>> addUpdateblog(List<BlogStoryObject> blogItems) { List<BlogStoryObject> result = new ArrayList<BlogStoryObject>(); //TODO:: Call Service to update/save objects return new ResponseEntity<List<RootBlogStoryObject>>(result, HttpStatus.OK); } } Exception Details [Truncated]: And the error thrown at runtime is Failed to instantiate [java.util.List]: Specified class is an interface. Solution Solution to the problem is to @RequestBody annotation to the method definition, so the following will work. public ResponseEntity<List<RootBlogStoryObject>> addUpdateblog...