You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Loading data having a property using a type discriminator from a worker thread (i.e. from a rest controller in a parallel stream) sometimes results in the following error:
org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.foo.Bar]: Specified class is an interface
The following aspects seem to be relevant in order to run into this issue:
the entity must contain a field of an interface type that contains several concrete implementations as values
the entity has to be loaded from a separate thread other than the http handler thread (e.g. from a worker thread of the common pool)
the application has to be run from the Spring Boot jar (e.g. from command line or a Docker image), not from the IDE
Note: I am aware that this issue might not be caused by Spring Data MongoDB directly, but by Spring Data or even by Spring Boot. Please advice in case the issue should be opened in a different Spring project repository. Thank you!
The text was updated successfully, but these errors were encountered:
This is a duplicate of #3905. Please make sure to either use type aliases or set the class loader accordingly. ForkJoin thread pools use the system class loader and not Spring's class loader.
Loading data having a property using a type discriminator from a worker thread (i.e. from a rest controller in a parallel stream) sometimes results in the following error:
The following aspects seem to be relevant in order to run into this issue:
Please see https://github.com/cstettler/spring-data-mongo-loading-issue for a minimal sample application based on Spring Boot 2.6.1 and Spring Data Mongo 3.3.0 to reproduce the issue and further explanation / results of the investigation done so far.
Note: I am aware that this issue might not be caused by Spring Data MongoDB directly, but by Spring Data or even by Spring Boot. Please advice in case the issue should be opened in a different Spring project repository. Thank you!
The text was updated successfully, but these errors were encountered: