[jackson-user] JsonMappingException: Can not resolve PropertyFilter with id
Hi , I have a common bean that I am using in my 2 separate REST calls.Both the calls have different output attributes from same bean (i.e CampainBean) CampaignBean has 3 attributes - id , name and status Rest Call 1 - needs to show "id" and "name" Rest Call 2 - Need to show "id","name" and "status" Rest call 1 controller has this filter - FilterProvider filters = new SimpleFilterProvider().addFilter("campaignBeanFilter",SimpleBeanPropertyFilter.filterOutAllExcept("id","name","status")); Rest call 2 controller has this filter - FilterProvider filters = new SimpleFilterProvider().addFilter("campaignBeanFilter",SimpleBeanPropertyFilter.filterOutAllExcept("id","name")); Rest call 1 works fine but when I hit rest call 2 , it gives following exception - e>com.fasterxml.jackson.databind.JsonMappingException: Can not resolve PropertyFilter with id 'campaignBeanFilter'; no FilterProvider configured Am I missing anything in configuration ? -- 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.
[jackson-user] StackOverflowError in deeply nested JSON
I'm trying to serialize a JSON object that represents a conversation tree. Here's the POJO: class Node { @JsonProperty("children") private List children; @JsonProperty("text") private String text;} Eventually the tree ends with a Node with an empty list of children. The problem is: serializing a deep tree (say, 50 nodes deep) causes a StackOverflowError on Android devices using the Dalvik runtime since it only has a 32kb stack size. Is there any way to avoid using recursion in Jackson? Is there a more efficient way to represent my POJO? Will migrating to Jackson Jr. help solve my problems? I'm using Jackson 2.7.5. -- 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.
Re: [jackson-user] com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 10))
Thank you very much for the response. I looked through the defects and agree that I didn't see anything related to this. The Feature setting you specified will help us out a ton. Our environment is pretty "structured" for getting new releases, but we'll try to get the patch release. Thanks again! On Thursday, June 30, 2016 at 12:25:32 PM UTC-5, Tatu Saloranta wrote: > > If content does indeed contain character 10 (Unicode), that is, linefeed, > it is prohibited by JSON specification (should be escaped as \n), so the > content should be fixed and parser is right to report it. > This is assuming content does have that; cut'n pasting JSON can not quite > tell that, so you'd have to check it. > > However it is possible to make parser more lenient by enabling > `JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS` to let this violation be > skipped and character included as-is during parsing. > > So: caller should NOT send such unescaped characters, but you may want to > temporarily enable those before sender has been fixed. > > Hope this helps, > > -+ Tatu +- > > ps. Not too that version 2.5.0 is old and there are patch releases, so > should at least upgrade to 2.5.5 -- I don't think there are bug fixes > relevant to this use case but it's good habit to ensure latest patch is > used before checking for bugs > > > > On Thu, Jun 30, 2016 at 8:55 AM, Gregg Freeman> wrote: > >> We're trying to parse this JSON received from a 3rd party: >> >> { >> "comments": >> "\\", >> "foo": "bar" >> } >> >> However, Jackson (2.5.0) seem to throw the exception in the title. >> Should Jackson be able to successfully parse this? >> >> -- >> 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...@googlegroups.com . >> To post to this group, send email to jackso...@googlegroups.com >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- 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.
Re: [jackson-user] com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 10))
If content does indeed contain character 10 (Unicode), that is, linefeed, it is prohibited by JSON specification (should be escaped as \n), so the content should be fixed and parser is right to report it. This is assuming content does have that; cut'n pasting JSON can not quite tell that, so you'd have to check it. However it is possible to make parser more lenient by enabling `JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS` to let this violation be skipped and character included as-is during parsing. So: caller should NOT send such unescaped characters, but you may want to temporarily enable those before sender has been fixed. Hope this helps, -+ Tatu +- ps. Not too that version 2.5.0 is old and there are patch releases, so should at least upgrade to 2.5.5 -- I don't think there are bug fixes relevant to this use case but it's good habit to ensure latest patch is used before checking for bugs On Thu, Jun 30, 2016 at 8:55 AM, Gregg Freemanwrote: > We're trying to parse this JSON received from a 3rd party: > > { > "comments": > "\\", > "foo": "bar" > } > > However, Jackson (2.5.0) seem to throw the exception in the title. Should > Jackson be able to successfully parse this? > > -- > 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. > -- 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.