diff --git a/model/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionFactoryProvider.java b/model/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionFactoryProvider.java index f66c989eff..3bc9c7a6a9 100755 --- a/model/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionFactoryProvider.java +++ b/model/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionFactoryProvider.java @@ -180,7 +180,7 @@ public class DefaultMongoConnectionFactoryProvider implements MongoConnectionPro private Class[] getManagedEntities() throws ClassNotFoundException { Class[] entityClasses = new Class[entities.length]; for (int i = 0; i < entities.length; i++) { - entityClasses[i] = Thread.currentThread().getContextClassLoader().loadClass(entities[i]); + entityClasses[i] = getClass().getClassLoader().loadClass(entities[i]); } return entityClasses; }