Resource Adapt To Custom Model Class Issue with Model Factory Get Image Class
We have two components:
Book Component (sling:resourceSuperType="xyz/components/image")
Book Listing Component
In Book Component Model Implementation, init method we are using Modal Factory to get image model.
"image = modelFactory.getModelFromWrappedRequest(request, request.getResource(), Image.class);"
In Listing component Component Model Implementation, init method based on some filters, we are getting few Book Pages. From these book pages we are getting their respective book details node which we are trying to adapt to Book Model.
"org.apache.sling.models.factory.PostConstructException: Post-construct method has thrown an exception for model class com.xyz.core.models.impl.BookDetailsImpl"
at com.xyz.core.models.impl.BookDetailsImpl.initModel"