This happens way too often: you POST or PUT something to a Spring @RestController and Spring only tells you that there is a bad request, HTTP 400 code; no further explanations, no logs, no exceptions. Spring logs the error cause under the category "org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod" so you can enable logging for that in your log4j.properties: log4j.logger.org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod=DEBUG,stdout … Continue reading Debugging Spring REST bad request 400 codes
Tag: REST
An easier to use Java REST client
I recently was duped (by myself) at a discussion with a colleague: in our continuous effort to disentangle release schedules of two tightly entangled applications, I exposed some core features as a JSON REST service and told him to "just use the Spring invoker" for JSON. It turns out, there is one for JaxRS, Burlap, … Continue reading An easier to use Java REST client
Integration testing Spring controllers
Time-constrained projects sometimes mandate crude realism as to the type and extent of test coverage in a software project. You'll find arguments for and against testing in the entire spectrum of opinions from "tests are luxury we can't afford" to "regressions are luxury we can't afford". Constrained or not, there is rarely a good excuse … Continue reading Integration testing Spring controllers