Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Jackson mapper infinite incursion with sling models


Level 3
when converting sling models to jackson mapper I am getting  java.lang.IllegalArgumentException: Infinite recursion (StackOverflowError) (through reference chain:["resource"]

ReportPage page = (ReportPage) report;

Map<String, Object> reportPagePropMap = objectMapper.convertValue(page, // failing here

new TypeReference<Map<String, Object>>() { 


Where ReportPage is a slingModel defined as 

@Model(,defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)

public class ReportPage  {


private Resource resource;

1 Reply


Level 3

Can you provide more info exactly you want to do in the model class?


Sample Code or Logic that you want to achieve?



Veena K