-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
StackOverflowError with contentConverter that returns array type #357
Comments
Your guess on cause is probably correct: annotation handling is difficult because it is difficult to figure out exact applicability when a chain of conversions (of handlers) is executed. In the meantime I think the safest work-around actually involves use of |
I can reproduce this successfully with sample code. |
As part of the fix, I suggest to add a comment to the JavaDoc about the precedence of the various
The JavaDoc already has some comments in that direction (e.g., it mentions that "some properties block others"), but it would be great to be more specific. |
Right, this is a case where options overlap. My thinking is that if en explicit serializer ( Question of |
…contextualization, infinite recursion
Alas: it looks like my fix did not fully work; it just happened to add a different flaw that did fix converter problem, but caused other issues. Essentially removal of lock failed, and so lock lasted until end of current processing ( So it's back to square one, with 2.7.4. :-( |
Hello, |
@nazymko No, unfortunately there is no known working fix. Earlier attempt did hide the problem, but in a way that broke any nested resolution (or one that follows in document order, even if not nested). |
I think that
The |
@TuomasKiviaho is that with the original code here, or something else? Test case I had was slightly simplified but it passes. I don't doubt there's a remaining problem, just want to reproduce it -- the whole contextualization is tricky to get right, esp. for content (de)serializers. |
Original test as-is seems to pass, and test does use |
This should be reproducible by having
|
What I mean is a unit test, both as demonstration and to guard against regression, using actual API or declarations to get there. |
At this point, can not reproduce, so closing. I am not arguing that this does not occur, simply that I have no way of triggering this with actual usage and as such do not trust that tests that manipulate internal state would faithfully reproduce problem users might encountered (or, more importantly, verify that fix is appropriate). A new issue should be filed with reproduction if this is encountered (with ref back to this as background) in wild. |
Jackson version: 2.3.0
The following code snippet
produces the following endless recursion:
It seems that the @JsonSerialize annotation is applied both before and after the conversion.
The text was updated successfully, but these errors were encountered: