'SOLR: No converter found capable of converting from type [org.apache.solr.common.SolrDocument] to type [MyCustomBean2]

I am getting the following error when I try to do a queryForFacetPage using SolrTemplate

org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [org.apache.solr.common.SolrDocument] to type [mypackage.MyCustomBean2]

These are the two pojos that I am using to receive the data:

@Getter
@Setter
public class MyCustomBean1 {
    private DocType docType;
    private int id;
    private MyCustomBean2 myCustomBean2;
    private LocalDate birthDate;
}
@Getter
@Setter
public class MyCustomBean2 {
    private DocType docType;
    private int id;
    private String name;
}

**for some reason it cannot convert to the child document**

The error occurs at this point

Page<MyCustomBean1> respuesta = solrTemplate.queryForFacetPage("collection_name", query, MyCustomBean1.class);

thx :)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source