ConventionSetPrivateFieldImpl throws a NPE when mapping a POJO with a getter method. This getter isn't related to a backing field, it is simply a business getter (like getTotal() of a sale).
The relevant part of stacktrace is:
java.lang.NullPointerException: nulljava.lang.NullPointerException: null at org.bson.codecs.pojo.ConventionSetPrivateFieldImpl.apply(ConventionSetPrivateFieldImpl.java:36) at org.bson.codecs.pojo.ClassModelBuilder.build(ClassModelBuilder.java:252) at org.bson.codecs.pojo.PojoCodecProvider.createClassModel(PojoCodecProvider.java:214) at org.bson.codecs.pojo.PojoCodecProvider.getPojoCodec(PojoCodecProvider.java:78) at org.bson.codecs.pojo.PojoCodecProvider.get(PojoCodecProvider.java:68) at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:43) at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:55) at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:37) at com.mongodb.internal.operation.Operations.createFindOperation(Operations.java:144) at com.mongodb.internal.operation.Operations.findFirst(Operations.java:128) at com.mongodb.internal.operation.AsyncOperations.findFirst(AsyncOperations.java:81) at com.mongodb.async.client.FindIterableImpl.first(FindIterableImpl.java:197)
Debugging to discover the NPE source i'm got to this point of failure at line 36 of bson/src/main/org/bson/codecs/pojo/ConventionSetPrivateFieldImpl.java:
if (!propertyMetaData.isDeserializable() && isPrivate(propertyMetaData.getField().getModifiers()))
When the propertyMetaData has state:
setter=null field=null getter=not null
The return of isDeserializable is false, then after ! the other condition of && is tested, in this the propertyMetadaData.getField() that is null, is acessed without nullable check.