Closed MaartenTutak closed 7 years ago
The first thing I would try is moving that line to the setupSpec
block to see if that works - this is typically where I register the models in my specs, although I will look into why it's not working in feature methods.
I tried moving it to the setupSpec
block, but that didn't do the trick either.
Ugh, I figured it out.. My Sling Model doesn't have a default constructor. I found out after digging around and finding the following exception.
org.apache.sling.models.factory.ModelClassException: Unable to find a useable constructor for model class be.tutak.jcr.example.entity.ProductEntity
My bad, thanks for your time.
Glad you found the problem, thanks for updating!
Hi,
I'm currently experimenting with Prosper, and I have the following issue. Adapting a resource to a Sling Model is not working, eventhough the following call has been made.
slingContext.addModelsForPackage("be.tutak.jcr.example.entity")
example code
Any ideas ? Thanks!