<https://lh3.googleusercontent.com/-YFzl3oCs4No/V_9MpbNFJDI/AAAAAAAAADA/mvXJe_ZQkwoYhMbAeFjGWu4sv6N7z9wbwCLcB/s1600/QQ20161013-0%25402x.png>
Hi, 

I am new to use jackson in my project, and today i meet a issue, i try to 
parse the reason, but cant.

I have a object, and set a construct by @JsonCreator, like the blow picture.

<https://lh3.googleusercontent.com/-YJ-LSRVj4jU/V_9IGAEAJgI/AAAAAAAAACY/hd7XyzqsZa8ud276Po1cmoQewVVZZsdhACLcB/s1600/post.tiff>


When i test with the normal situation, the result is ok. But when i 
transfer a String var to Integer var, i meet the issue.

I have write a ExceptionMapper, it will mapper all exception to a response, 
include the Jackson exception. All action

is normal until the exception object be serialized to json, i got 
StackOverFlow error because of infinite recursion. 

Like this:

<https://lh3.googleusercontent.com/-lsJxY2DwFls/V_9Jk9kQSiI/AAAAAAAAACk/sDg9Xw6DUMUOBZzMw3OquW5268_wN6d0QCLcB/s1600/te2.tiff>



i try to debug the flow, this is flow description:


1. the exception occur in the deserialization action when jackson read json 
string from client,


my test string is {"post_id": "test", "post_title": "test"}.


2. and then the exception is proceed by my exception mapper, i set this 
exception object as 


response body.


3. then the server write json response by jackson, when write it, appear 
the infinite recursion error.



This is my exception logic:


<https://lh3.googleusercontent.com/-WxOQ_ov9dL0/V_9LZFkmr2I/AAAAAAAAAC0/fyBcfAtfuU0fVsNdb7mYcalwG7PWR9chACLcB/s1600/t3.tiff>


and my debug picture(before the error occur, it is serialize flow):


<https://lh3.googleusercontent.com/-YFzl3oCs4No/V_9MpbNFJDI/AAAAAAAAADA/mvXJe_ZQkwoYhMbAeFjGWu4sv6N7z9wbwCLcB/s1600/QQ20161013-0%25402x.png>


Really need help to find the issue. 


Tip: when i removed the method that has @JsonCreator annotation, the 
infinite recursion error disappear!


Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jackson-user+unsubscr...@googlegroups.com.
To post to this group, send email to jackson-user@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to