I just started developing some app in Java with spring-data-mongodb and came across some issue that I haven\'t been able to solve:
Have a couple of document beans li
I had a similar problem, I have a class that implements an interface and when I use findAll
I get the error:
org.springframework.data.mapping.model.MappingInstantiationException: Could not instantiate bean class [test.MetaClasse]: Specified class is an interface.
After debugging SpringData
code, I realized that Mapper uses @TypeAlias
to discover the type it has to instantiate, so I just put @TypeAlias("FullClassName")
on my implementations of test.MetaClasse
and it worked!
I tested with your situation and it will work!