diff --git a/core/src/main/java/org/neo4j/ogm/metadata/ClassInfo.java b/core/src/main/java/org/neo4j/ogm/metadata/ClassInfo.java index dbe39f4f1c..33bb74e1ea 100644 --- a/core/src/main/java/org/neo4j/ogm/metadata/ClassInfo.java +++ b/core/src/main/java/org/neo4j/ogm/metadata/ClassInfo.java @@ -1264,7 +1264,7 @@ private Map addIndexes() { // No way to get declared fields from current byte code impl. Using reflection instead. Field[] declaredFields; try { - declaredFields = Class.forName(className).getDeclaredFields(); + declaredFields = MetaDataClassLoader.loadClass(className).getDeclaredFields(); } catch (ClassNotFoundException e) { throw new RuntimeException("Could not reflectively read declared fields", e); }