Java error in DBRef of mongo Driver

Getting error on MongoDB : Can’t find a codec for class com.mongodb.DBRef.
I’m getting below error while execution of mule flow. Let me know if anyone know about this.

I couldn’t find suitable answer.


org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class com.mongodb.DBRef.

at org.bson.internal.CodecCache.getOrThrow(CodecCache.java:57)

at org.bson.internal.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:64)

at org.bson.internal.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:39)

at org.bson.codecs.DocumentCodec.writeValue(DocumentCodec.java:197)

at org.bson.codecs.DocumentCodec.writeMap(DocumentCodec.java:212)

at org.bson.codecs.DocumentCodec.encode(DocumentCodec.java:154)

Did you check some popular answers for this error? e.g. this. java - Resolve DBRef into Json - Stack Overflow