New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rest Endpoints produce HttpMessageNotWritableException sometimes after restarts [DATAREST-716] #1085
Comments
Andrew Walters commented The root cause of this seems to lie in the jackson-databind library:
In the case of the Now, I'm not a fan of how that's been implemented - a boolean check guarding a class cast which can end up with a blow up like this isn't great - but I think there's an issue within
A null check here would ensure the property is never inadvertently set to true, but I don't think the implementation as it stands will ever do anything practical anyway - I presume to have any impact (and be compatible with the jackson-databind code) we'd need to return an instance of At least in the short term though a null guard should be put in place which should alleviate this issue (though as I've said this is unconfirmed - I've only had time to trace the code through from stack traces, not execution - as the actual cause but looks a bad smell at the very least). |
Andrew Walters commented Actually taking a bit more of a look, even a null check probably isn't sufficient - the unwrapping property should be always set to false until a proper UnwrappingBeanSerializer can be returned as other code within jackson-databind invokes the Interim solution - remove |
Oliver Drotbohm commented Sounds like a duplicate of DATREST-697, which was fixed for Gosling SR2 and is already available via Spring Boot 1.3.1. Would you mind giving that a try? |
Andrew Walters commented Looks good to me Oliver. Upgrading from Gosling-RELEASE to SR2 seems to resolve the issue as you've said |
Oliver Drotbohm commented Awesome, happy coding! :) |
Collin Brown commented It looks like I am still seeing this occur in Spring Boot 1.3.1.
|
Oliver Drotbohm commented Please don't reopen tickets that have been marked as fixed on already released versions (Gosling SR2 in this case) as this will create inconsistencies regarding the changelogs. Feel free to create a new ticket, which we can link to this one then |
Tim Meißner opened DATAREST-716 and commented
In some cases after application start some rest repositories fail to handle the http request and throw a HttpMessageNotWritableException (see StackOverflow reference)
Affects: 2.4.1 (Gosling SR1), 2.5 M1 (Hopper)
Reference URL: http://stackoverflow.com/questions/32572525/spring-data-rest-2-4-intermittent-error-classcastexception
Issue Links:
("duplicates")
Referenced from: commits a8f271a, 88c97a6
Backported to: 2.4.2 (Gosling SR2)
1 votes, 5 watchers
The text was updated successfully, but these errors were encountered: