[JAVA-2838] Log ClassModel creation errors for automatic PojoCodecs Created: 23/Apr/18  Updated: 28/Oct/23  Resolved: 21/Jun/18

Status: Closed
Project: Java Driver
Component/s: Monitoring
Affects Version/s: None
Fix Version/s: 3.8.0

Type: Improvement Priority: Major - P3
Reporter: Charles Sarrazin (Inactive) Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Whenever automatic configuration or namespace whitelisting is used, class models generated through lazy-loading seem to fail silently (and returning null).

This makes it complex to identify the source of the actual error, if some POJOs are incorrectly defined, as the original model creation error is lost. A simple workaround is to explicitly add the class mentioned in the CodecConfigurationException, but that is painful, especially when multiple POJOs may actually be incorrect.

In such cases, we should log the error, to ease the debugging process.



 Comments   
Comment by Githook User [ 21/Jun/18 ]

Author:

{'username': 'rozza', 'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com'}

Message: PojoCodecProvider improvements for automatic / package based classes.

Logs a warning if a class being lookup is incompatible with the
PojoCodec

JAVA-2838
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/a59a1243681264bbff9283318113a9e7e5b8b328

Generated at Thu Feb 08 08:58:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.