diff --git a/extensions/mongodb-client/deployment/src/main/java/io/quarkus/mongodb/deployment/MongoClientProcessor.java b/extensions/mongodb-client/deployment/src/main/java/io/quarkus/mongodb/deployment/MongoClientProcessor.java index 8e39a69b41746..3eb4fd9546eb4 100644 --- a/extensions/mongodb-client/deployment/src/main/java/io/quarkus/mongodb/deployment/MongoClientProcessor.java +++ b/extensions/mongodb-client/deployment/src/main/java/io/quarkus/mongodb/deployment/MongoClientProcessor.java @@ -135,11 +135,13 @@ List addExtensionPointsToNative(CodecProviderBuildItem reflectiveClassNames.addAll(propertyCodecProviders.getPropertyCodecProviderClassNames()); reflectiveClassNames.addAll(bsonDiscriminators.getBsonDiscriminatorClassNames()); reflectiveClassNames.addAll(commandListeners.getCommandListenerClassNames()); - reflectiveClassNames.add(ChangeStreamDocument.class.getName()); - return reflectiveClassNames.stream() + List reflectiveClass = reflectiveClassNames.stream() .map(s -> new ReflectiveClassBuildItem(true, true, false, s)) - .collect(Collectors.toList()); + .collect(Collectors.toCollection(() -> new ArrayList<>())); + // ChangeStreamDocument needs to be registered for reflection with its fields. + reflectiveClass.add(new ReflectiveClassBuildItem(true, true, true, ChangeStreamDocument.class.getName())); + return reflectiveClass; } @BuildStep